diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml
index 022236e7af..0bd6e41e24 100644
--- a/.github/workflows/style.yml
+++ b/.github/workflows/style.yml
@@ -2,9 +2,7 @@ name: Style
on:
push:
- branches-ignore: [master]
pull_request:
- branches: [master]
jobs:
php:
@@ -12,42 +10,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v2
-
- - name: Get changed files
- uses: dorny/paths-filter@v2
- id: filter
- with:
- list-files: shell
- base: ${{ github.ref }}
- filters: |
- addedOrModified:
- - added|modified: '**.php'
+ uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
- if: ${{ steps.filter.outputs.addedOrModified == 'true' }}
with:
php-version: '7.4'
- - name: Get Composer cache directory path
- id: composer-cache-dir
- if: ${{ steps.filter.outputs.addedOrModified == 'true' }}
- run: |
- echo "::set-output name=path::$(composer config cache-files-dir)"
-
- - name: Cache Composer dependencies
- uses: actions/cache@v2
- if: ${{ steps.filter.outputs.addedOrModified == 'true' }}
+ - name: PHP-CS-Fixer cache
+ uses: actions/cache@v4
with:
- path: ${{ steps.composer-cache-dir.outputs.path }}
- key: composer-${{ hashFiles('composer.lock') }}
- restore-keys: composer-
-
- - name: Install PHP-CS-Fixer
- if: ${{ steps.filter.outputs.addedOrModified == 'true' }}
- run: composer global require friendsofphp/php-cs-fixer:^3.4
+ path: .php-cs-fixer.cache
+ key: php-cs-fixer-${{ github.sha }}
+ restore-keys: php-cs-fixer-
- name: Run PHP-CS-Fixer
- if: ${{ steps.filter.outputs.addedOrModified == 'true' }}
- run: composer global exec -- php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --path-mode=intersection ${{ steps.filter.outputs.addedOrModified_files }}
+ run: vendor/bin/php-cs-fixer fix --dry-run --diff
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
index 0f783c0e38..daba1050f1 100644
--- a/.php-cs-fixer.dist.php
+++ b/.php-cs-fixer.dist.php
@@ -1,186 +1,56 @@
notPath('mobile/lib/smarty')
- ->notPath('okapi')
- ->notPath('src/Libs')
- ->notPath('vendor')
->in(__DIR__)
- ->name('*.php')
+ ->path('src')
+ ->notPath('src/Libs')
+ ->notPath('src/Utils/Database/Updates/template.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return (new PhpCsFixer\Config())
+ ->setParallelConfig(ParallelConfigFactory::detect())
+ ->setFinder($finder)
+ ->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
-
- // Alias
- 'backtick_to_shell_exec' => true,
- 'no_alias_language_construct_call' => true,
- 'no_mixed_echo_print' => true,
-
- // Array Notation
- 'array_syntax' => ['syntax' => 'short'],
- 'no_multiline_whitespace_around_double_arrow' => true,
- 'no_trailing_comma_in_singleline_array' => true,
- 'no_whitespace_before_comma_in_array' => true,
- 'normalize_index_brace' => true,
- 'trailing_comma_in_multiline' => ['elements' => ['arrays']],
- 'trim_array_spaces' => true,
- 'whitespace_after_comma_in_array' => true,
-
- // Basic
- 'braces' => [
- 'allow_single_line_anonymous_class_with_empty_body' => true,
- 'allow_single_line_closure' => true,
- ],
-
- // Casing
- 'magic_constant_casing' => true,
- 'magic_method_casing' => true,
- 'native_function_casing' => true,
- 'native_function_type_declaration_casing' => true,
-
- // Cast Notation
- 'cast_spaces' => true,
- 'no_short_bool_cast' => true,
- 'no_unset_cast' => true,
-
- // Class Notation
- 'class_attributes_separation' => true,
- 'ordered_class_elements' => ['order' => [
- 'use_trait', 'constant', 'property', 'construct', 'method', 'magic',
- ]],
- 'self_static_accessor' => true,
-
- // Comment
- 'multiline_comment_opening_closing' => true,
- 'single_line_comment_style' => true,
-
- // Control Structure
- 'include' => true,
- 'no_alternative_syntax' => true,
- 'no_superfluous_elseif' => true,
- 'no_trailing_comma_in_list_call' => true,
- 'no_unneeded_control_parentheses' => true,
- 'no_unneeded_curly_braces' => true,
- 'no_useless_else' => true,
- 'simplified_if_return' => true,
- 'switch_continue_to_break' => true,
-
- // Function Notation
- 'function_typehint_space' => true,
- 'lambda_not_used_import' => true,
- 'nullable_type_declaration_for_default_null_value' => [
- 'use_nullable_type_declaration' => false,
- ],
-
- // Import
- 'fully_qualified_strict_types' => true,
- 'global_namespace_import' => true,
- 'no_unused_imports' => true,
- 'ordered_imports' => [
- 'imports_order' => ['class', 'function', 'const'],
- 'sort_algorithm' => 'alpha',
- ],
-
- // Language Construct
- 'combine_consecutive_issets' => true,
- 'combine_consecutive_unsets' => true,
- 'explicit_indirect_variable' => true,
- 'single_space_after_construct' => true,
-
- // List Notation
- 'list_syntax' => ['syntax' => 'short'],
-
- // Namespace Notation
- 'clean_namespace' => true,
- 'no_leading_namespace_whitespace' => true,
-
- // Operator
- 'binary_operator_spaces' => ['operators' => ['|' => null]],
- 'concat_space' => ['spacing' => 'one'],
- 'increment_style' => ['style' => 'post'],
- 'not_operator_with_successor_space' => true,
- 'object_operator_without_whitespace' => true,
- 'operator_linebreak' => true,
- 'standardize_increment' => true,
- 'standardize_not_equals' => true,
- 'ternary_to_null_coalescing' => true,
- 'unary_operator_spaces' => true,
-
- // PHP Tag
- // 'echo_tag_syntax' => true,
- 'linebreak_after_opening_tag' => true,
-
- // PHPDoc
- 'align_multiline_comment' => true,
- 'general_phpdoc_tag_rename' => [
- 'replacements' => ['inheritDocs' => 'inheritDoc'],
- ],
- // 'no_blank_lines_after_phpdoc' => true,
- 'no_empty_phpdoc' => true,
- 'no_superfluous_phpdoc_tags' => [
- 'allow_mixed' => true,
- 'allow_unused_params' => true,
- ],
- 'phpdoc_align' => [
- 'tags' => ['param', 'property', 'property-read', 'property-write', 'return', 'throws', 'type', 'var', 'method'],
- 'align' => 'left',
- ],
- 'phpdoc_annotation_without_dot' => true,
- 'phpdoc_indent' => true,
- 'phpdoc_inline_tag_normalizer' => true,
- 'phpdoc_line_span' => ['const' => 'single', 'property' => 'single'],
- 'phpdoc_no_access' => true,
- 'phpdoc_no_alias_tag' => ['replacements' => ['type' => 'var', 'link' => 'see']],
- 'phpdoc_no_empty_return' => true,
- 'phpdoc_no_package' => true,
- 'phpdoc_no_useless_inheritdoc' => true,
- 'phpdoc_return_self_reference' => true,
- 'phpdoc_scalar' => true,
- 'phpdoc_single_line_var_spacing' => true,
- // 'phpdoc_summary' => true,
- 'phpdoc_tag_casing' => true,
- // 'phpdoc_to_comment' => true,
- 'phpdoc_trim_consecutive_blank_line_separation' => true,
- 'phpdoc_trim' => true,
- 'phpdoc_types' => true,
- 'phpdoc_types_order' => [
- 'sort_algorithm' => 'none',
- 'null_adjustment' => 'always_last',
- ],
- 'phpdoc_var_annotation_correct_order' => true,
- 'phpdoc_var_without_name' => true,
-
- // Return Notation
- 'no_useless_return' => true,
- 'simplified_null_return' => true,
-
- // Semicolon
- 'multiline_whitespace_before_semicolons' => true,
- 'no_empty_statement' => true,
- 'no_singleline_whitespace_before_semicolons' => true,
- 'semicolon_after_instruction' => true,
- 'space_after_semicolon' => ['remove_in_empty_for_expressions' => true],
-
- // String Notation
- 'explicit_string_variable' => true,
- 'heredoc_to_nowdoc' => true,
- 'no_binary_string' => true,
- 'simple_to_complex_string_variable' => true,
- 'single_quote' => true,
- 'escape_implicit_backslashes' => ['single_quoted' => false],
-
- // Whitespace
- 'array_indentation' => true,
- 'blank_line_before_statement' => ['statements' => [
- 'continue', 'declare', 'do', 'exit', 'for', 'foreach', 'if', 'include', 'include_once', 'require', 'require_once', 'return', 'switch', 'throw', 'try', 'while', 'yield', 'yield_from',
- ]],
- 'heredoc_indentation' => true,
- 'no_extra_blank_lines' => ['tokens' => [
- 'break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'switch', 'throw', 'use',
- ]],
- 'no_spaces_around_offset' => true,
- ])
- ->setFinder($finder);
+ '@PSR12:risky' => true,
+
+ // To be enabled later
+ 'binary_operator_spaces' => false,
+ 'blank_line_after_namespace' => false,
+ 'blank_line_after_opening_tag' => false,
+ 'blank_lines_before_namespace' => false,
+ 'braces_position' => false,
+ 'class_definition' => false,
+ 'constant_case' => false,
+ 'control_structure_braces' => false,
+ 'control_structure_continuation_position' => false,
+ 'elseif' => false,
+ 'function_declaration' => false,
+ 'line_ending' => false,
+ 'lowercase_keywords' => false,
+ 'method_argument_space' => false,
+ 'new_with_parentheses' => false,
+ 'no_blank_lines_after_class_opening' => false,
+ 'no_break_comment' => false,
+ 'no_closing_tag' => false,
+ 'no_leading_import_slash' => false,
+ 'no_multiple_statements_per_line' => false,
+ 'no_spaces_after_function_name' => false,
+ 'no_trailing_whitespace_in_comment' => false,
+ 'no_whitespace_in_blank_line' => false,
+ 'return_type_declaration' => false,
+ 'short_scalar_cast' => false,
+ 'single_blank_line_at_eof' => false,
+ 'single_class_element_per_statement' => false,
+ 'single_line_after_imports' => false,
+ 'spaces_inside_parentheses' => false,
+ 'statement_indentation' => false,
+ 'switch_case_space' => false,
+ 'ternary_operator_spaces' => false,
+ 'unary_operator_spaces' => false,
+ 'visibility_required' => false,
+ ]);
diff --git a/composer.json b/composer.json
index c3c7cdd61f..4f6eae7353 100755
--- a/composer.json
+++ b/composer.json
@@ -19,7 +19,7 @@
"ezyang/htmlpurifier": "^4.13",
"kint-php/kint": "^3.3",
"npm-asset/js-cookie": "^2.1.3",
- "friendsofphp/php-cs-fixer": "^3.4"
+ "friendsofphp/php-cs-fixer": "^3.61"
},
"autoload": {
"psr-4": {
diff --git a/composer.lock b/composer.lock
index b403fe353f..2b2159696b 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": "82763b0d455f0f9f4b03cb9e6d4946c3",
+ "content-hash": "c988c7b22bbea22154665735a55f4800",
"packages": [
{
"name": "aferrandini/phpqrcode",
@@ -55,6 +55,70 @@
"abandoned": "endroid/qr-code",
"time": "2013-07-08T09:39:08+00:00"
},
+ {
+ "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.0.0",
@@ -128,16 +192,16 @@
},
{
"name": "composer/semver",
- "version": "3.3.1",
+ "version": "3.4.2",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "5d8e574bb0e69188786b8ef77d43341222a41a71"
+ "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/5d8e574bb0e69188786b8ef77d43341222a41a71",
- "reference": "5d8e574bb0e69188786b8ef77d43341222a41a71",
+ "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6",
+ "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6",
"shasum": ""
},
"require": {
@@ -187,9 +251,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.1"
+ "source": "https://github.com/composer/semver/tree/3.4.2"
},
"funding": [
{
@@ -205,7 +269,7 @@
"type": "tidelift"
}
],
- "time": "2022-03-16T11:22:07+00:00"
+ "time": "2024-07-12T11:35:52+00:00"
},
{
"name": "composer/xdebug-handler",
@@ -274,36 +338,29 @@
"time": "2022-02-25T21:32:43+00:00"
},
{
- "name": "doctrine/annotations",
- "version": "1.13.2",
+ "name": "evenement/evenement",
+ "version": "v3.0.2",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/annotations.git",
- "reference": "5b668aef16090008790395c02c893b1ba13f7e08"
+ "url": "https://github.com/igorw/evenement.git",
+ "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08",
- "reference": "5b668aef16090008790395c02c893b1ba13f7e08",
+ "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc",
+ "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc",
"shasum": ""
},
"require": {
- "doctrine/lexer": "1.*",
- "ext-tokenizer": "*",
- "php": "^7.1 || ^8.0",
- "psr/cache": "^1 || ^2 || ^3"
+ "php": ">=7.0"
},
"require-dev": {
- "doctrine/cache": "^1.11 || ^2.0",
- "doctrine/coding-standard": "^6.0 || ^8.1",
- "phpstan/phpstan": "^0.12.20",
- "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5",
- "symfony/cache": "^4.4 || ^5.2"
+ "phpunit/phpunit": "^9 || ^6"
},
"type": "library",
"autoload": {
"psr-4": {
- "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+ "Evenement\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -312,66 +369,277 @@
],
"authors": [
{
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
+ "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": "ezyang/htmlpurifier",
+ "version": "v4.14.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ezyang/htmlpurifier.git",
+ "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
+ "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "library/HTMLPurifier.composer.php"
+ ],
+ "psr-0": {
+ "HTMLPurifier": "library/"
},
+ "exclude-from-classmap": [
+ "/library/HTMLPurifier/Language/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1-or-later"
+ ],
+ "authors": [
{
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
+ "name": "Edward Z. Yang",
+ "email": "admin@htmlpurifier.org",
+ "homepage": "http://ezyang.com"
+ }
+ ],
+ "description": "Standards compliant HTML filter written in PHP",
+ "homepage": "http://htmlpurifier.org/",
+ "keywords": [
+ "html"
+ ],
+ "support": {
+ "issues": "https://github.com/ezyang/htmlpurifier/issues",
+ "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0"
+ },
+ "time": "2021-12-25T01:21:49+00:00"
+ },
+ {
+ "name": "fidry/cpu-core-counter",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/theofidry/cpu-core-counter.git",
+ "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42",
+ "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42",
+ "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": "Benjamin Eberlei",
- "email": "kontakt@beberlei.de"
+ "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.1.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theofidry",
+ "type": "github"
+ }
+ ],
+ "time": "2024-02-07T09:43:46+00:00"
+ },
+ {
+ "name": "friendsofphp/php-cs-fixer",
+ "version": "v3.61.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
+ "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/94a87189f55814e6cabca2d9a33b06de384a2ab8",
+ "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8",
+ "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.0",
+ "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.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",
+ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
+ },
+ "require-dev": {
+ "facile-it/paraunit": "^1.3 || ^2.3",
+ "infection/infection": "^0.29.5",
+ "justinrainbow/json-schema": "^5.2",
+ "keradus/cli-executor": "^2.1",
+ "mikey179/vfsstream": "^1.6.11",
+ "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.19 || ^10.5.21 || ^11.2",
+ "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
+ "symfony/yaml": "^5.4 || ^6.0 || ^7.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": "Jonathan Wage",
- "email": "jonwage@gmail.com"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
},
{
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
+ "name": "Dariusz Rumiński",
+ "email": "dariusz.ruminski@gmail.com"
}
],
- "description": "Docblock Annotations Parser",
- "homepage": "https://www.doctrine-project.org/projects/annotations.html",
+ "description": "A tool to automatically fix PHP code style",
"keywords": [
- "annotations",
- "docblock",
- "parser"
+ "Static code analysis",
+ "fixer",
+ "standards",
+ "static analysis"
],
"support": {
- "issues": "https://github.com/doctrine/annotations/issues",
- "source": "https://github.com/doctrine/annotations/tree/1.13.2"
+ "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.61.1"
},
- "time": "2021-08-05T19:00:23+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/keradus",
+ "type": "github"
+ }
+ ],
+ "time": "2024-07-31T14:33:15+00:00"
},
{
- "name": "doctrine/lexer",
- "version": "1.2.3",
+ "name": "kint-php/kint",
+ "version": "3.3",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/lexer.git",
- "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229"
+ "url": "https://github.com/kint-php/kint.git",
+ "reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229",
- "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229",
+ "url": "https://api.github.com/repos/kint-php/kint/zipball/335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
+ "reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
"shasum": ""
},
"require": {
- "php": "^7.1 || ^8.0"
+ "php": ">=5.3.6"
},
"require-dev": {
- "doctrine/coding-standard": "^9.0",
- "phpstan/phpstan": "^1.3",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "vimeo/psalm": "^4.11"
+ "friendsofphp/php-cs-fixer": "^2.0",
+ "phpunit/phpunit": "^4.0",
+ "seld/phar-utils": "^1.0",
+ "symfony/finder": "^2.0 || ^3.0 || ^4.0",
+ "vimeo/psalm": "^3.0"
+ },
+ "suggest": {
+ "ext-ctype": "Simple data type tests",
+ "ext-iconv": "Provides fallback detection for ambiguous legacy string encodings such as the Windows and ISO 8859 code pages",
+ "ext-mbstring": "Provides string encoding detection",
+ "kint-php/kint-js": "Provides a simplified dump to console.log()",
+ "kint-php/kint-twig": "Provides d() and s() functions in twig templates",
+ "symfony/polyfill-ctype": "Replacement for ext-ctype if missing",
+ "symfony/polyfill-iconv": "Replacement for ext-iconv if missing",
+ "symfony/polyfill-mbstring": "Replacement for ext-mbstring if missing"
},
"type": "library",
"autoload": {
+ "files": [
+ "init.php"
+ ],
"psr-4": {
- "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer"
+ "Kint\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -380,158 +648,292 @@
],
"authors": [
{
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
+ "name": "Jonathan Vollebregt",
+ "homepage": "https://github.com/jnvsor"
},
{
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
+ "name": "Rokas Šleinius",
+ "homepage": "https://github.com/raveren"
},
{
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
+ "name": "Contributors",
+ "homepage": "https://github.com/kint-php/kint/graphs/contributors"
}
],
- "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": "Kint - debugging tool for PHP developers",
+ "homepage": "https://kint-php.github.io/kint/",
"keywords": [
- "annotations",
- "docblock",
- "lexer",
- "parser",
+ "debug",
+ "kint",
"php"
],
"support": {
- "issues": "https://github.com/doctrine/lexer/issues",
- "source": "https://github.com/doctrine/lexer/tree/1.2.3"
+ "issues": "https://github.com/kint-php/kint/issues",
+ "source": "https://github.com/kint-php/kint/tree/master"
},
- "funding": [
+ "time": "2019-10-17T18:05:24+00:00"
+ },
+ {
+ "name": "npm-asset/js-cookie",
+ "version": "2.1.3",
+ "dist": {
+ "type": "tar",
+ "url": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.1.3.tgz"
+ },
+ "type": "npm-asset",
+ "license": [
+ "MIT"
+ ]
+ },
+ {
+ "name": "psr/container",
+ "version": "1.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.4.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
{
- "url": "https://www.doctrine-project.org/sponsorship.html",
- "type": "custom"
- },
+ "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/1.1.2"
+ },
+ "time": "2021-11-05T16:50:12+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": [
{
- "url": "https://www.patreon.com/phpdoctrine",
- "type": "patreon"
- },
+ "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": "1.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
{
- "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
- "type": "tidelift"
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
}
],
- "time": "2022-02-28T11:07:21+00:00"
+ "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/1.1.4"
+ },
+ "time": "2021-05-03T11:20:27+00:00"
},
{
- "name": "ezyang/htmlpurifier",
- "version": "v4.14.0",
+ "name": "react/cache",
+ "version": "v1.2.0",
"source": {
"type": "git",
- "url": "https://github.com/ezyang/htmlpurifier.git",
- "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75"
+ "url": "https://github.com/reactphp/cache.git",
+ "reference": "d47c472b64aa5608225f47965a484b75c7817d5b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
- "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
+ "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b",
+ "reference": "d47c472b64aa5608225f47965a484b75c7817d5b",
"shasum": ""
},
"require": {
- "php": ">=5.2"
+ "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": {
- "files": [
- "library/HTMLPurifier.composer.php"
- ],
- "psr-0": {
- "HTMLPurifier": "library/"
- },
- "exclude-from-classmap": [
- "/library/HTMLPurifier/Language/"
- ]
+ "psr-4": {
+ "React\\Cache\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "LGPL-2.1-or-later"
+ "MIT"
],
"authors": [
{
- "name": "Edward Z. Yang",
- "email": "admin@htmlpurifier.org",
- "homepage": "http://ezyang.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": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
}
],
- "description": "Standards compliant HTML filter written in PHP",
- "homepage": "http://htmlpurifier.org/",
+ "description": "Async, Promise-based cache interface for ReactPHP",
"keywords": [
- "html"
+ "cache",
+ "caching",
+ "promise",
+ "reactphp"
],
"support": {
- "issues": "https://github.com/ezyang/htmlpurifier/issues",
- "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0"
+ "issues": "https://github.com/reactphp/cache/issues",
+ "source": "https://github.com/reactphp/cache/tree/v1.2.0"
},
- "time": "2021-12-25T01:21:49+00:00"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2022-11-30T15:59:55+00:00"
},
{
- "name": "friendsofphp/php-cs-fixer",
- "version": "v3.8.0",
+ "name": "react/child-process",
+ "version": "v0.6.5",
"source": {
"type": "git",
- "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
- "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3"
+ "url": "https://github.com/reactphp/child-process.git",
+ "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3",
- "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3",
+ "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43",
+ "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43",
"shasum": ""
},
"require": {
- "composer/semver": "^3.2",
- "composer/xdebug-handler": "^3.0.3",
- "doctrine/annotations": "^1.13",
- "ext-json": "*",
- "ext-tokenizer": "*",
- "php": "^7.4 || ^8.0",
- "php-cs-fixer/diff": "^2.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.23",
- "symfony/polyfill-php80": "^1.25",
- "symfony/polyfill-php81": "^1.25",
- "symfony/process": "^5.4 || ^6.0",
- "symfony/stopwatch": "^5.4 || ^6.0"
+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",
+ "php": ">=5.3.0",
+ "react/event-loop": "^1.2",
+ "react/stream": "^1.2"
},
"require-dev": {
- "justinrainbow/json-schema": "^5.2",
- "keradus/cli-executor": "^1.5",
- "mikey179/vfsstream": "^1.6.10",
- "php-coveralls/php-coveralls": "^2.5.2",
- "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.15",
- "phpspec/prophecy-phpunit": "^2.0",
- "phpunit/phpunit": "^9.5",
- "phpunitgoodpractices/polyfill": "^1.5",
- "phpunitgoodpractices/traits": "^1.9.1",
- "symfony/phpunit-bridge": "^6.0",
- "symfony/yaml": "^5.4 || ^6.0"
- },
- "suggest": {
- "ext-dom": "For handling output formats in XML",
- "ext-mbstring": "For handling non-UTF8 characters."
+ "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35",
+ "react/socket": "^1.8",
+ "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0"
},
- "bin": [
- "php-cs-fixer"
- ],
- "type": "application",
+ "type": "library",
"autoload": {
"psr-4": {
- "PhpCsFixer\\": "src/"
+ "React\\ChildProcess\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -540,68 +942,77 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
},
{
- "name": "Dariusz Rumiński",
- "email": "dariusz.ruminski@gmail.com"
+ "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": "A tool to automatically fix PHP code style",
+ "description": "Event-driven library for executing child processes with ReactPHP.",
+ "keywords": [
+ "event-driven",
+ "process",
+ "reactphp"
+ ],
"support": {
- "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues",
- "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0"
+ "issues": "https://github.com/reactphp/child-process/issues",
+ "source": "https://github.com/reactphp/child-process/tree/v0.6.5"
},
"funding": [
{
- "url": "https://github.com/keradus",
+ "url": "https://github.com/WyriHaximus",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/clue",
"type": "github"
}
],
- "time": "2022-03-18T17:20:59+00:00"
+ "time": "2022-09-16T13:41:56+00:00"
},
{
- "name": "kint-php/kint",
- "version": "3.3",
+ "name": "react/dns",
+ "version": "v1.13.0",
"source": {
"type": "git",
- "url": "https://github.com/kint-php/kint.git",
- "reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b"
+ "url": "https://github.com/reactphp/dns.git",
+ "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/kint-php/kint/zipball/335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
- "reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
+ "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5",
+ "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5",
"shasum": ""
},
"require": {
- "php": ">=5.3.6"
+ "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": {
- "friendsofphp/php-cs-fixer": "^2.0",
- "phpunit/phpunit": "^4.0",
- "seld/phar-utils": "^1.0",
- "symfony/finder": "^2.0 || ^3.0 || ^4.0",
- "vimeo/psalm": "^3.0"
- },
- "suggest": {
- "ext-ctype": "Simple data type tests",
- "ext-iconv": "Provides fallback detection for ambiguous legacy string encodings such as the Windows and ISO 8859 code pages",
- "ext-mbstring": "Provides string encoding detection",
- "kint-php/kint-js": "Provides a simplified dump to console.log()",
- "kint-php/kint-twig": "Provides d() and s() functions in twig templates",
- "symfony/polyfill-ctype": "Replacement for ext-ctype if missing",
- "symfony/polyfill-iconv": "Replacement for ext-iconv if missing",
- "symfony/polyfill-mbstring": "Replacement for ext-mbstring if missing"
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36",
+ "react/async": "^4.3 || ^3 || ^2",
+ "react/promise-timer": "^1.11"
},
"type": "library",
"autoload": {
- "files": [
- "init.php"
- ],
"psr-4": {
- "Kint\\": "src/"
+ "React\\Dns\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -610,121 +1021,145 @@
],
"authors": [
{
- "name": "Jonathan Vollebregt",
- "homepage": "https://github.com/jnvsor"
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
},
{
- "name": "Rokas Šleinius",
- "homepage": "https://github.com/raveren"
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
},
{
- "name": "Contributors",
- "homepage": "https://github.com/kint-php/kint/graphs/contributors"
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
}
],
- "description": "Kint - debugging tool for PHP developers",
- "homepage": "https://kint-php.github.io/kint/",
+ "description": "Async DNS resolver for ReactPHP",
"keywords": [
- "debug",
- "kint",
- "php"
+ "async",
+ "dns",
+ "dns-resolver",
+ "reactphp"
],
"support": {
- "issues": "https://github.com/kint-php/kint/issues",
- "source": "https://github.com/kint-php/kint/tree/master"
- },
- "time": "2019-10-17T18:05:24+00:00"
- },
- {
- "name": "npm-asset/js-cookie",
- "version": "2.1.3",
- "dist": {
- "type": "tar",
- "url": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.1.3.tgz"
+ "issues": "https://github.com/reactphp/dns/issues",
+ "source": "https://github.com/reactphp/dns/tree/v1.13.0"
},
- "type": "npm-asset",
- "license": [
- "MIT"
- ]
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-06-13T14:18:03+00:00"
},
{
- "name": "php-cs-fixer/diff",
- "version": "v2.0.2",
+ "name": "react/event-loop",
+ "version": "v1.5.0",
"source": {
"type": "git",
- "url": "https://github.com/PHP-CS-Fixer/diff.git",
- "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3"
+ "url": "https://github.com/reactphp/event-loop.git",
+ "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3",
- "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3",
+ "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354",
+ "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354",
"shasum": ""
},
"require": {
- "php": "^5.6 || ^7.0 || ^8.0"
+ "php": ">=5.3.0"
},
"require-dev": {
- "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0",
- "symfony/process": "^3.3"
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
+ },
+ "suggest": {
+ "ext-pcntl": "For signal handling support when using the StreamSelectLoop"
},
"type": "library",
"autoload": {
- "classmap": [
- "src/"
- ]
+ "psr-4": {
+ "React\\EventLoop\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
},
{
- "name": "Kore Nordmann",
- "email": "mail@kore-nordmann.de"
+ "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": "sebastian/diff v3 backport support for PHP 5.6+",
- "homepage": "https://github.com/PHP-CS-Fixer",
+ "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.",
"keywords": [
- "diff"
+ "asynchronous",
+ "event-loop"
],
"support": {
- "issues": "https://github.com/PHP-CS-Fixer/diff/issues",
- "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2"
+ "issues": "https://github.com/reactphp/event-loop/issues",
+ "source": "https://github.com/reactphp/event-loop/tree/v1.5.0"
},
- "time": "2020-10-14T08:32:19+00:00"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2023-11-13T13:48:05+00:00"
},
{
- "name": "psr/cache",
- "version": "1.0.1",
+ "name": "react/promise",
+ "version": "v3.2.0",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/cache.git",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
+ "url": "https://github.com/reactphp/promise.git",
+ "reference": "8a164643313c71354582dc850b42b33fa12a4b63"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63",
+ "reference": "8a164643313c71354582dc850b42b33fa12a4b63",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=7.1.0"
},
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
+ "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": {
- "Psr\\Cache\\": "src/"
+ "React\\Promise\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -733,42 +1168,75 @@
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "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": "Common interface for caching libraries",
+ "description": "A lightweight implementation of CommonJS Promises/A for PHP",
"keywords": [
- "cache",
- "psr",
- "psr-6"
+ "promise",
+ "promises"
],
"support": {
- "source": "https://github.com/php-fig/cache/tree/master"
+ "issues": "https://github.com/reactphp/promise/issues",
+ "source": "https://github.com/reactphp/promise/tree/v3.2.0"
},
- "time": "2016-08-06T20:24:11+00:00"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-05-24T10:39:05+00:00"
},
{
- "name": "psr/container",
- "version": "1.1.2",
+ "name": "react/socket",
+ "version": "v1.16.0",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/container.git",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
+ "url": "https://github.com/reactphp/socket.git",
+ "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
+ "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1",
+ "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1",
"shasum": ""
},
"require": {
- "php": ">=7.4.0"
+ "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": {
- "Psr\\Container\\": "src/"
+ "React\\Socket\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -777,51 +1245,73 @@
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
+ "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": "Common Container Interface (PHP FIG PSR-11)",
- "homepage": "https://github.com/php-fig/container",
+ "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP",
"keywords": [
- "PSR-11",
- "container",
- "container-interface",
- "container-interop",
- "psr"
+ "Connection",
+ "Socket",
+ "async",
+ "reactphp",
+ "stream"
],
"support": {
- "issues": "https://github.com/php-fig/container/issues",
- "source": "https://github.com/php-fig/container/tree/1.1.2"
+ "issues": "https://github.com/reactphp/socket/issues",
+ "source": "https://github.com/reactphp/socket/tree/v1.16.0"
},
- "time": "2021-11-05T16:50:12+00:00"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-07-26T10:38:09+00:00"
},
{
- "name": "psr/event-dispatcher",
- "version": "1.0.0",
+ "name": "react/stream",
+ "version": "v1.4.0",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/event-dispatcher.git",
- "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0"
+ "url": "https://github.com/reactphp/stream.git",
+ "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0",
- "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0",
+ "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d",
+ "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d",
"shasum": ""
},
"require": {
- "php": ">=7.2.0"
+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",
+ "php": ">=5.3.8",
+ "react/event-loop": "^1.2"
},
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
+ "require-dev": {
+ "clue/stream-filter": "~1.2",
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
},
+ "type": "library",
"autoload": {
"psr-4": {
- "Psr\\EventDispatcher\\": "src/"
+ "React\\Stream\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -830,71 +1320,114 @@
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "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": "Standard interfaces for event handling.",
+ "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP",
"keywords": [
- "events",
- "psr",
- "psr-14"
+ "event-driven",
+ "io",
+ "non-blocking",
+ "pipe",
+ "reactphp",
+ "readable",
+ "stream",
+ "writable"
],
"support": {
- "issues": "https://github.com/php-fig/event-dispatcher/issues",
- "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0"
+ "issues": "https://github.com/reactphp/stream/issues",
+ "source": "https://github.com/reactphp/stream/tree/v1.4.0"
},
- "time": "2019-01-08T18:20:26+00:00"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-06-11T12:45:25+00:00"
},
{
- "name": "psr/log",
- "version": "1.1.4",
+ "name": "sebastian/diff",
+ "version": "4.0.6",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc",
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3",
+ "symfony/process": "^4.2 || ^5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
- "psr-4": {
- "Psr\\Log\\": "Psr/Log/"
- }
+ "classmap": [
+ "src/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "BSD-3-Clause"
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
}
],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
"keywords": [
- "log",
- "psr",
- "psr-3"
+ "diff",
+ "udiff",
+ "unidiff",
+ "unified diff"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/1.1.4"
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6"
},
- "time": "2021-05-03T11:20:27+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:30:58+00:00"
},
{
"name": "symfony/console",
@@ -1671,16 +2204,16 @@
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.25.0",
+ "version": "v1.30.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
+ "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
- "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c",
+ "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c",
"shasum": ""
},
"require": {
@@ -1694,9 +2227,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -1734,7 +2264,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0"
},
"funding": [
{
@@ -1750,7 +2280,7 @@
"type": "tidelift"
}
],
- "time": "2021-11-30T18:21:41+00:00"
+ "time": "2024-06-19T12:30:46+00:00"
},
{
"name": "symfony/polyfill-php73",
@@ -1833,16 +2363,16 @@
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.25.0",
+ "version": "v1.30.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
+ "reference": "77fa7995ac1b21ab60769b7323d600a991a90433"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
- "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433",
+ "reference": "77fa7995ac1b21ab60769b7323d600a991a90433",
"shasum": ""
},
"require": {
@@ -1850,9 +2380,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -1896,7 +2423,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0"
},
"funding": [
{
@@ -1912,20 +2439,20 @@
"type": "tidelift"
}
],
- "time": "2022-03-04T08:16:47+00:00"
+ "time": "2024-05-31T15:07:36+00:00"
},
{
"name": "symfony/polyfill-php81",
- "version": "v1.25.0",
+ "version": "v1.30.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f"
+ "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
- "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af",
+ "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af",
"shasum": ""
},
"require": {
@@ -1933,9 +2460,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -1975,7 +2499,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0"
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0"
},
"funding": [
{
@@ -1991,7 +2515,7 @@
"type": "tidelift"
}
],
- "time": "2021-09-13T13:58:11+00:00"
+ "time": "2024-06-19T12:30:46+00:00"
},
{
"name": "symfony/process",
@@ -2294,7 +2818,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": "^7.4",
+ "php": ">=7.4",
"ext-json": "*",
"ext-gettext": "*",
"ext-gd": "*",
@@ -2308,5 +2832,5 @@
"ext-openssl": "*"
},
"platform-dev": [],
- "plugin-api-version": "2.3.0"
+ "plugin-api-version": "2.6.0"
}
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 174cce4d54..97594f6ec6 100644
--- a/vendor/autoload.php
+++ b/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 ComposerAutoloaderInit2532e47646cbd0ac2fbb391e55b03321::getLoader();
diff --git a/vendor/bin/php-cs-fixer b/vendor/bin/php-cs-fixer
old mode 100644
new mode 100755
index 897061a4fc..d40411aa93
--- a/vendor/bin/php-cs-fixer
+++ b/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/vendor/bin/php-cs-fixer.bat b/vendor/bin/php-cs-fixer.bat
deleted file mode 100644
index 83db5d5987..0000000000
--- a/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/vendor/clue/ndjson-react/.github/FUNDING.yml b/vendor/clue/ndjson-react/.github/FUNDING.yml
new file mode 100644
index 0000000000..9c09fb8784
--- /dev/null
+++ b/vendor/clue/ndjson-react/.github/FUNDING.yml
@@ -0,0 +1,2 @@
+github: clue
+custom: https://clue.engineering/support
diff --git a/vendor/clue/ndjson-react/CHANGELOG.md b/vendor/clue/ndjson-react/CHANGELOG.md
new file mode 100644
index 0000000000..bc4faf6939
--- /dev/null
+++ b/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/vendor/doctrine/lexer/LICENSE b/vendor/clue/ndjson-react/LICENSE
similarity index 58%
rename from vendor/doctrine/lexer/LICENSE
rename to vendor/clue/ndjson-react/LICENSE
index e8fdec4afb..7baae8e9a5 100644
--- a/vendor/doctrine/lexer/LICENSE
+++ b/vendor/clue/ndjson-react/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) 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/vendor/clue/ndjson-react/README.md b/vendor/clue/ndjson-react/README.md
new file mode 100644
index 0000000000..0ca4eabe1e
--- /dev/null
+++ b/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/vendor/clue/ndjson-react/composer.json b/vendor/clue/ndjson-react/composer.json
new file mode 100644
index 0000000000..01a4b8594f
--- /dev/null
+++ b/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/vendor/clue/ndjson-react/src/Decoder.php b/vendor/clue/ndjson-react/src/Decoder.php
new file mode 100644
index 0000000000..876ff2b11e
--- /dev/null
+++ b/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/vendor/clue/ndjson-react/src/Encoder.php b/vendor/clue/ndjson-react/src/Encoder.php
new file mode 100644
index 0000000000..30d5c311dd
--- /dev/null
+++ b/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/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
index afef3fa2ad..7824d8f7ea 100644
--- a/vendor/composer/ClassLoader.php
+++ b/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/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php
index 41bc143c11..51e734a774 100644
--- a/vendor/composer/InstalledVersions.php
+++ b/vendor/composer/InstalledVersions.php
@@ -28,7 +28,7 @@ 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;
@@ -39,7 +39,7 @@ class InstalledVersions
/**
* @var array[]
- * @psalm-var array}>
+ * @psalm-var array}>
*/
private static $installedByVendor = array();
@@ -98,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;
}
}
@@ -119,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);
@@ -243,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()
{
@@ -257,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()
{
@@ -280,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()
{
@@ -303,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)
{
@@ -313,7 +313,7 @@ public static function reload($data)
/**
* @return array[]
- * @psalm-return list}>
+ * @psalm-return list}>
*/
private static function getInstalled()
{
@@ -328,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];
}
@@ -340,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/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index eab5cf60a4..6f97ca1317 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -7,6 +7,7 @@
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',
'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
@@ -14,24 +15,24 @@
'OpenChecker\\OpenCheckerSetup' => $baseDir . '/modules/openchecker/openchecker_classes.php',
'OpenChecker\\Pagination' => $baseDir . '/modules/openchecker/openchecker_classes.php',
'OpenChecker\\convertLongLat' => $baseDir . '/modules/openchecker/openchecker_classes.php',
- 'PhpCsFixer\\Diff\\Chunk' => $vendorDir . '/php-cs-fixer/diff/src/Chunk.php',
- 'PhpCsFixer\\Diff\\ConfigurationException' => $vendorDir . '/php-cs-fixer/diff/src/Exception/ConfigurationException.php',
- 'PhpCsFixer\\Diff\\Diff' => $vendorDir . '/php-cs-fixer/diff/src/Diff.php',
- 'PhpCsFixer\\Diff\\Differ' => $vendorDir . '/php-cs-fixer/diff/src/Differ.php',
- 'PhpCsFixer\\Diff\\Exception' => $vendorDir . '/php-cs-fixer/diff/src/Exception/Exception.php',
- 'PhpCsFixer\\Diff\\InvalidArgumentException' => $vendorDir . '/php-cs-fixer/diff/src/Exception/InvalidArgumentException.php',
- 'PhpCsFixer\\Diff\\Line' => $vendorDir . '/php-cs-fixer/diff/src/Line.php',
- 'PhpCsFixer\\Diff\\LongestCommonSubsequenceCalculator' => $vendorDir . '/php-cs-fixer/diff/src/LongestCommonSubsequenceCalculator.php',
- 'PhpCsFixer\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => $vendorDir . '/php-cs-fixer/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php',
- 'PhpCsFixer\\Diff\\Output\\AbstractChunkOutputBuilder' => $vendorDir . '/php-cs-fixer/diff/src/Output/AbstractChunkOutputBuilder.php',
- 'PhpCsFixer\\Diff\\Output\\DiffOnlyOutputBuilder' => $vendorDir . '/php-cs-fixer/diff/src/Output/DiffOnlyOutputBuilder.php',
- 'PhpCsFixer\\Diff\\Output\\DiffOutputBuilderInterface' => $vendorDir . '/php-cs-fixer/diff/src/Output/DiffOutputBuilderInterface.php',
- 'PhpCsFixer\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => $vendorDir . '/php-cs-fixer/diff/src/Output/StrictUnifiedDiffOutputBuilder.php',
- 'PhpCsFixer\\Diff\\Output\\UnifiedDiffOutputBuilder' => $vendorDir . '/php-cs-fixer/diff/src/Output/UnifiedDiffOutputBuilder.php',
- 'PhpCsFixer\\Diff\\Parser' => $vendorDir . '/php-cs-fixer/diff/src/Parser.php',
- 'PhpCsFixer\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => $vendorDir . '/php-cs-fixer/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.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/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php
index 90e070f69e..b6d120b292 100644
--- a/vendor/composer/autoload_files.php
+++ b/vendor/composer/autoload_files.php
@@ -8,6 +8,7 @@
return array(
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
+ 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
index 30fabefed8..3f412ae2be 100644
--- a/vendor/composer/autoload_psr4.php
+++ b/vendor/composer/autoload_psr4.php
@@ -25,15 +25,22 @@
'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/Psr/Log'),
'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'),
'Kint\\' => array($vendorDir . '/kint-php/kint/src'),
- 'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer'),
- '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/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index 523abcad7e..3a6aa88044 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -29,29 +29,22 @@ public static function getLoader()
spl_autoload_unregister(array('ComposerAutoloaderInit2532e47646cbd0ac2fbb391e55b03321', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
- \Composer\Autoload\ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321::getInitializer($loader)();
+ call_user_func(\Composer\Autoload\ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321::getInitializer($loader));
$loader->register(true);
- $includeFiles = \Composer\Autoload\ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321::$files;
- foreach ($includeFiles as $fileIdentifier => $file) {
- composerRequire2532e47646cbd0ac2fbb391e55b03321($fileIdentifier, $file);
+ $filesToLoad = \Composer\Autoload\ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321::$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;
}
}
-
-/**
- * @param string $fileIdentifier
- * @param string $file
- * @return void
- */
-function composerRequire2532e47646cbd0ac2fbb391e55b03321($fileIdentifier, $file)
-{
- if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
- $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
-
- require $file;
- }
-}
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index 9d486c5e9b..73346cd38a 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -9,6 +9,7 @@ class ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
+ 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
@@ -49,28 +50,41 @@ class ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321
'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,
),
'K' =>
array (
'Kint\\' => 5,
),
- '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,
),
);
@@ -151,6 +165,34 @@ class ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321
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/Psr/Log',
@@ -163,10 +205,6 @@ class ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321
array (
0 => __DIR__ . '/..' . '/psr/container/src',
),
- 'Psr\\Cache\\' =>
- array (
- 0 => __DIR__ . '/..' . '/psr/cache/src',
- ),
'PhpCsFixer\\' =>
array (
0 => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src',
@@ -175,13 +213,13 @@ class ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321
array (
0 => __DIR__ . '/..' . '/kint-php/kint/src',
),
- 'Doctrine\\Common\\Lexer\\' =>
+ 'Fidry\\CpuCoreCounter\\' =>
array (
- 0 => __DIR__ . '/..' . '/doctrine/lexer/lib/Doctrine/Common/Lexer',
+ 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 (
@@ -195,6 +233,10 @@ class ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321
array (
0 => __DIR__ . '/..' . '/composer/pcre/src',
),
+ 'Clue\\React\\NDJson\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/clue/ndjson-react/src',
+ ),
);
public static $prefixesPsr0 = array (
@@ -216,6 +258,7 @@ class ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321
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',
'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
@@ -223,24 +266,24 @@ class ComposerStaticInit2532e47646cbd0ac2fbb391e55b03321
'OpenChecker\\OpenCheckerSetup' => __DIR__ . '/../..' . '/modules/openchecker/openchecker_classes.php',
'OpenChecker\\Pagination' => __DIR__ . '/../..' . '/modules/openchecker/openchecker_classes.php',
'OpenChecker\\convertLongLat' => __DIR__ . '/../..' . '/modules/openchecker/openchecker_classes.php',
- 'PhpCsFixer\\Diff\\Chunk' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Chunk.php',
- 'PhpCsFixer\\Diff\\ConfigurationException' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Exception/ConfigurationException.php',
- 'PhpCsFixer\\Diff\\Diff' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Diff.php',
- 'PhpCsFixer\\Diff\\Differ' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Differ.php',
- 'PhpCsFixer\\Diff\\Exception' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Exception/Exception.php',
- 'PhpCsFixer\\Diff\\InvalidArgumentException' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Exception/InvalidArgumentException.php',
- 'PhpCsFixer\\Diff\\Line' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Line.php',
- 'PhpCsFixer\\Diff\\LongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/LongestCommonSubsequenceCalculator.php',
- 'PhpCsFixer\\Diff\\MemoryEfficientLongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php',
- 'PhpCsFixer\\Diff\\Output\\AbstractChunkOutputBuilder' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Output/AbstractChunkOutputBuilder.php',
- 'PhpCsFixer\\Diff\\Output\\DiffOnlyOutputBuilder' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Output/DiffOnlyOutputBuilder.php',
- 'PhpCsFixer\\Diff\\Output\\DiffOutputBuilderInterface' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Output/DiffOutputBuilderInterface.php',
- 'PhpCsFixer\\Diff\\Output\\StrictUnifiedDiffOutputBuilder' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Output/StrictUnifiedDiffOutputBuilder.php',
- 'PhpCsFixer\\Diff\\Output\\UnifiedDiffOutputBuilder' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Output/UnifiedDiffOutputBuilder.php',
- 'PhpCsFixer\\Diff\\Parser' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/Parser.php',
- 'PhpCsFixer\\Diff\\TimeEfficientLongestCommonSubsequenceCalculator' => __DIR__ . '/..' . '/php-cs-fixer/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.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',
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 44c73e5a66..621dc95d21 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -48,6 +48,73 @@
"abandoned": "endroid/qr-code",
"install-path": "../aferrandini/phpqrcode"
},
+ {
+ "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.0.0",
@@ -124,17 +191,17 @@
},
{
"name": "composer/semver",
- "version": "3.3.1",
- "version_normalized": "3.3.1.0",
+ "version": "3.4.2",
+ "version_normalized": "3.4.2.0",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "5d8e574bb0e69188786b8ef77d43341222a41a71"
+ "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/5d8e574bb0e69188786b8ef77d43341222a41a71",
- "reference": "5d8e574bb0e69188786b8ef77d43341222a41a71",
+ "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6",
+ "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6",
"shasum": ""
},
"require": {
@@ -144,7 +211,7 @@
"phpstan/phpstan": "^1.4",
"symfony/phpunit-bridge": "^4.2 || ^5"
},
- "time": "2022-03-16T11:22:07+00:00",
+ "time": "2024-07-12T11:35:52+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -186,9 +253,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.1"
+ "source": "https://github.com/composer/semver/tree/3.4.2"
},
"funding": [
{
@@ -276,39 +343,32 @@
"install-path": "./xdebug-handler"
},
{
- "name": "doctrine/annotations",
- "version": "1.13.2",
- "version_normalized": "1.13.2.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": "5b668aef16090008790395c02c893b1ba13f7e08"
+ "url": "https://github.com/igorw/evenement.git",
+ "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08",
- "reference": "5b668aef16090008790395c02c893b1ba13f7e08",
+ "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc",
+ "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc",
"shasum": ""
},
"require": {
- "doctrine/lexer": "1.*",
- "ext-tokenizer": "*",
- "php": "^7.1 || ^8.0",
- "psr/cache": "^1 || ^2 || ^3"
+ "php": ">=7.0"
},
"require-dev": {
- "doctrine/cache": "^1.11 || ^2.0",
- "doctrine/coding-standard": "^6.0 || ^8.1",
- "phpstan/phpstan": "^0.12.20",
- "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5",
- "symfony/cache": "^4.4 || ^5.2"
+ "phpunit/phpunit": "^9 || ^6"
},
- "time": "2021-08-05T19:00:23+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/",
@@ -317,69 +377,289 @@
],
"authors": [
{
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
+ "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": "ezyang/htmlpurifier",
+ "version": "v4.14.0",
+ "version_normalized": "4.14.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ezyang/htmlpurifier.git",
+ "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
+ "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2"
+ },
+ "time": "2021-12-25T01:21:49+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "library/HTMLPurifier.composer.php"
+ ],
+ "psr-0": {
+ "HTMLPurifier": "library/"
},
+ "exclude-from-classmap": [
+ "/library/HTMLPurifier/Language/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1-or-later"
+ ],
+ "authors": [
{
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
+ "name": "Edward Z. Yang",
+ "email": "admin@htmlpurifier.org",
+ "homepage": "http://ezyang.com"
+ }
+ ],
+ "description": "Standards compliant HTML filter written in PHP",
+ "homepage": "http://htmlpurifier.org/",
+ "keywords": [
+ "html"
+ ],
+ "support": {
+ "issues": "https://github.com/ezyang/htmlpurifier/issues",
+ "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0"
+ },
+ "install-path": "../ezyang/htmlpurifier"
+ },
+ {
+ "name": "fidry/cpu-core-counter",
+ "version": "1.1.0",
+ "version_normalized": "1.1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/theofidry/cpu-core-counter.git",
+ "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42",
+ "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42",
+ "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-02-07T09:43:46+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Fidry\\CpuCoreCounter\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
{
- "name": "Benjamin Eberlei",
- "email": "kontakt@beberlei.de"
+ "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.1.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theofidry",
+ "type": "github"
+ }
+ ],
+ "install-path": "../fidry/cpu-core-counter"
+ },
+ {
+ "name": "friendsofphp/php-cs-fixer",
+ "version": "v3.61.1",
+ "version_normalized": "3.61.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
+ "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/94a87189f55814e6cabca2d9a33b06de384a2ab8",
+ "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8",
+ "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.0",
+ "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.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",
+ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
+ },
+ "require-dev": {
+ "facile-it/paraunit": "^1.3 || ^2.3",
+ "infection/infection": "^0.29.5",
+ "justinrainbow/json-schema": "^5.2",
+ "keradus/cli-executor": "^2.1",
+ "mikey179/vfsstream": "^1.6.11",
+ "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.19 || ^10.5.21 || ^11.2",
+ "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
+ "symfony/yaml": "^5.4 || ^6.0 || ^7.0"
+ },
+ "suggest": {
+ "ext-dom": "For handling output formats in XML",
+ "ext-mbstring": "For handling non-UTF8 characters."
+ },
+ "time": "2024-07-31T14:33:15+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": "Jonathan Wage",
- "email": "jonwage@gmail.com"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
},
{
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
+ "name": "Dariusz Rumiński",
+ "email": "dariusz.ruminski@gmail.com"
}
],
- "description": "Docblock Annotations Parser",
- "homepage": "https://www.doctrine-project.org/projects/annotations.html",
+ "description": "A tool to automatically fix PHP code style",
"keywords": [
- "annotations",
- "docblock",
- "parser"
+ "Static code analysis",
+ "fixer",
+ "standards",
+ "static analysis"
],
"support": {
- "issues": "https://github.com/doctrine/annotations/issues",
- "source": "https://github.com/doctrine/annotations/tree/1.13.2"
+ "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.61.1"
},
- "install-path": "../doctrine/annotations"
+ "funding": [
+ {
+ "url": "https://github.com/keradus",
+ "type": "github"
+ }
+ ],
+ "install-path": "../friendsofphp/php-cs-fixer"
},
{
- "name": "doctrine/lexer",
- "version": "1.2.3",
- "version_normalized": "1.2.3.0",
+ "name": "kint-php/kint",
+ "version": "3.3",
+ "version_normalized": "3.3.0.0",
"source": {
"type": "git",
- "url": "https://github.com/doctrine/lexer.git",
- "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229"
+ "url": "https://github.com/kint-php/kint.git",
+ "reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229",
- "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229",
+ "url": "https://api.github.com/repos/kint-php/kint/zipball/335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
+ "reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
"shasum": ""
},
"require": {
- "php": "^7.1 || ^8.0"
+ "php": ">=5.3.6"
},
"require-dev": {
- "doctrine/coding-standard": "^9.0",
- "phpstan/phpstan": "^1.3",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "vimeo/psalm": "^4.11"
+ "friendsofphp/php-cs-fixer": "^2.0",
+ "phpunit/phpunit": "^4.0",
+ "seld/phar-utils": "^1.0",
+ "symfony/finder": "^2.0 || ^3.0 || ^4.0",
+ "vimeo/psalm": "^3.0"
},
- "time": "2022-02-28T11:07:21+00:00",
+ "suggest": {
+ "ext-ctype": "Simple data type tests",
+ "ext-iconv": "Provides fallback detection for ambiguous legacy string encodings such as the Windows and ISO 8859 code pages",
+ "ext-mbstring": "Provides string encoding detection",
+ "kint-php/kint-js": "Provides a simplified dump to console.log()",
+ "kint-php/kint-twig": "Provides d() and s() functions in twig templates",
+ "symfony/polyfill-ctype": "Replacement for ext-ctype if missing",
+ "symfony/polyfill-iconv": "Replacement for ext-iconv if missing",
+ "symfony/polyfill-mbstring": "Replacement for ext-mbstring if missing"
+ },
+ "time": "2019-10-17T18:05:24+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
+ "files": [
+ "init.php"
+ ],
"psr-4": {
- "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer"
+ "Kint\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -388,164 +668,310 @@
],
"authors": [
{
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
+ "name": "Jonathan Vollebregt",
+ "homepage": "https://github.com/jnvsor"
},
{
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
+ "name": "Rokas Šleinius",
+ "homepage": "https://github.com/raveren"
},
{
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
+ "name": "Contributors",
+ "homepage": "https://github.com/kint-php/kint/graphs/contributors"
}
],
- "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": "Kint - debugging tool for PHP developers",
+ "homepage": "https://kint-php.github.io/kint/",
"keywords": [
- "annotations",
- "docblock",
- "lexer",
- "parser",
+ "debug",
+ "kint",
"php"
],
"support": {
- "issues": "https://github.com/doctrine/lexer/issues",
- "source": "https://github.com/doctrine/lexer/tree/1.2.3"
+ "issues": "https://github.com/kint-php/kint/issues",
+ "source": "https://github.com/kint-php/kint/tree/master"
},
- "funding": [
- {
- "url": "https://www.doctrine-project.org/sponsorship.html",
- "type": "custom"
- },
+ "install-path": "../kint-php/kint"
+ },
+ {
+ "name": "npm-asset/js-cookie",
+ "version": "2.1.3",
+ "version_normalized": "2.1.3.0",
+ "dist": {
+ "type": "tar",
+ "url": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.1.3.tgz"
+ },
+ "type": "npm-asset",
+ "installation-source": "dist",
+ "license": [
+ "MIT"
+ ],
+ "install-path": "../npm-asset/js-cookie"
+ },
+ {
+ "name": "psr/container",
+ "version": "1.1.2",
+ "version_normalized": "1.1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.4.0"
+ },
+ "time": "2021-11-05T16:50:12+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
{
- "url": "https://www.patreon.com/phpdoctrine",
- "type": "patreon"
- },
+ "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/1.1.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": [
{
- "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
- "type": "tidelift"
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
}
],
- "install-path": "../doctrine/lexer"
+ "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": "ezyang/htmlpurifier",
- "version": "v4.14.0",
- "version_normalized": "4.14.0.0",
+ "name": "psr/log",
+ "version": "1.1.4",
+ "version_normalized": "1.1.4.0",
"source": {
"type": "git",
- "url": "https://github.com/ezyang/htmlpurifier.git",
- "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75"
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
- "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": ""
},
"require": {
- "php": ">=5.2"
+ "php": ">=5.3.0"
},
- "time": "2021-12-25T01:21:49+00:00",
+ "time": "2021-05-03T11:20:27+00:00",
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
"installation-source": "dist",
"autoload": {
- "files": [
- "library/HTMLPurifier.composer.php"
- ],
- "psr-0": {
- "HTMLPurifier": "library/"
- },
- "exclude-from-classmap": [
- "/library/HTMLPurifier/Language/"
- ]
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "LGPL-2.1-or-later"
+ "MIT"
],
"authors": [
{
- "name": "Edward Z. Yang",
- "email": "admin@htmlpurifier.org",
- "homepage": "http://ezyang.com"
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
}
],
- "description": "Standards compliant HTML filter written in PHP",
- "homepage": "http://htmlpurifier.org/",
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
"keywords": [
- "html"
+ "log",
+ "psr",
+ "psr-3"
],
"support": {
- "issues": "https://github.com/ezyang/htmlpurifier/issues",
- "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0"
+ "source": "https://github.com/php-fig/log/tree/1.1.4"
},
- "install-path": "../ezyang/htmlpurifier"
+ "install-path": "../psr/log"
},
{
- "name": "friendsofphp/php-cs-fixer",
- "version": "v3.8.0",
- "version_normalized": "3.8.0.0",
+ "name": "react/cache",
+ "version": "v1.2.0",
+ "version_normalized": "1.2.0.0",
"source": {
"type": "git",
- "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
- "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3"
+ "url": "https://github.com/reactphp/cache.git",
+ "reference": "d47c472b64aa5608225f47965a484b75c7817d5b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3",
- "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3",
+ "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b",
+ "reference": "d47c472b64aa5608225f47965a484b75c7817d5b",
"shasum": ""
},
"require": {
- "composer/semver": "^3.2",
- "composer/xdebug-handler": "^3.0.3",
- "doctrine/annotations": "^1.13",
- "ext-json": "*",
- "ext-tokenizer": "*",
- "php": "^7.4 || ^8.0",
- "php-cs-fixer/diff": "^2.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.23",
- "symfony/polyfill-php80": "^1.25",
- "symfony/polyfill-php81": "^1.25",
- "symfony/process": "^5.4 || ^6.0",
- "symfony/stopwatch": "^5.4 || ^6.0"
+ "php": ">=5.3.0",
+ "react/promise": "^3.0 || ^2.0 || ^1.1"
},
"require-dev": {
- "justinrainbow/json-schema": "^5.2",
- "keradus/cli-executor": "^1.5",
- "mikey179/vfsstream": "^1.6.10",
- "php-coveralls/php-coveralls": "^2.5.2",
- "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.15",
- "phpspec/prophecy-phpunit": "^2.0",
- "phpunit/phpunit": "^9.5",
- "phpunitgoodpractices/polyfill": "^1.5",
- "phpunitgoodpractices/traits": "^1.9.1",
- "symfony/phpunit-bridge": "^6.0",
- "symfony/yaml": "^5.4 || ^6.0"
+ "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35"
},
- "suggest": {
- "ext-dom": "For handling output formats in XML",
- "ext-mbstring": "For handling non-UTF8 characters."
+ "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.5",
+ "version_normalized": "0.6.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/child-process.git",
+ "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43",
+ "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43",
+ "shasum": ""
+ },
+ "require": {
+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",
+ "php": ">=5.3.0",
+ "react/event-loop": "^1.2",
+ "react/stream": "^1.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35",
+ "react/socket": "^1.8",
+ "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0"
},
- "time": "2022-03-18T17:20:59+00:00",
- "bin": [
- "php-cs-fixer"
- ],
- "type": "application",
+ "time": "2022-09-16T13:41:56+00:00",
+ "type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
- "PhpCsFixer\\": "src/"
+ "React\\ChildProcess\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -554,71 +980,80 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
},
{
- "name": "Dariusz Rumiński",
- "email": "dariusz.ruminski@gmail.com"
+ "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": "A tool to automatically fix PHP code style",
+ "description": "Event-driven library for executing child processes with ReactPHP.",
+ "keywords": [
+ "event-driven",
+ "process",
+ "reactphp"
+ ],
"support": {
- "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues",
- "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0"
+ "issues": "https://github.com/reactphp/child-process/issues",
+ "source": "https://github.com/reactphp/child-process/tree/v0.6.5"
},
"funding": [
{
- "url": "https://github.com/keradus",
+ "url": "https://github.com/WyriHaximus",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/clue",
"type": "github"
}
],
- "install-path": "../friendsofphp/php-cs-fixer"
+ "install-path": "../react/child-process"
},
{
- "name": "kint-php/kint",
- "version": "3.3",
- "version_normalized": "3.3.0.0",
+ "name": "react/dns",
+ "version": "v1.13.0",
+ "version_normalized": "1.13.0.0",
"source": {
"type": "git",
- "url": "https://github.com/kint-php/kint.git",
- "reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b"
+ "url": "https://github.com/reactphp/dns.git",
+ "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/kint-php/kint/zipball/335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
- "reference": "335ac1bcaf04d87df70d8aa51e8887ba2c6d203b",
+ "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5",
+ "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5",
"shasum": ""
},
"require": {
- "php": ">=5.3.6"
+ "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": {
- "friendsofphp/php-cs-fixer": "^2.0",
- "phpunit/phpunit": "^4.0",
- "seld/phar-utils": "^1.0",
- "symfony/finder": "^2.0 || ^3.0 || ^4.0",
- "vimeo/psalm": "^3.0"
- },
- "suggest": {
- "ext-ctype": "Simple data type tests",
- "ext-iconv": "Provides fallback detection for ambiguous legacy string encodings such as the Windows and ISO 8859 code pages",
- "ext-mbstring": "Provides string encoding detection",
- "kint-php/kint-js": "Provides a simplified dump to console.log()",
- "kint-php/kint-twig": "Provides d() and s() functions in twig templates",
- "symfony/polyfill-ctype": "Replacement for ext-ctype if missing",
- "symfony/polyfill-iconv": "Replacement for ext-iconv if missing",
- "symfony/polyfill-mbstring": "Replacement for ext-mbstring if missing"
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36",
+ "react/async": "^4.3 || ^3 || ^2",
+ "react/promise-timer": "^1.11"
},
- "time": "2019-10-17T18:05:24+00:00",
+ "time": "2024-06-13T14:18:03+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
- "files": [
- "init.php"
- ],
"psr-4": {
- "Kint\\": "src/"
+ "React\\Dns\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -627,130 +1062,151 @@
],
"authors": [
{
- "name": "Jonathan Vollebregt",
- "homepage": "https://github.com/jnvsor"
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
},
{
- "name": "Rokas Šleinius",
- "homepage": "https://github.com/raveren"
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
},
{
- "name": "Contributors",
- "homepage": "https://github.com/kint-php/kint/graphs/contributors"
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
}
],
- "description": "Kint - debugging tool for PHP developers",
- "homepage": "https://kint-php.github.io/kint/",
+ "description": "Async DNS resolver for ReactPHP",
"keywords": [
- "debug",
- "kint",
- "php"
+ "async",
+ "dns",
+ "dns-resolver",
+ "reactphp"
],
"support": {
- "issues": "https://github.com/kint-php/kint/issues",
- "source": "https://github.com/kint-php/kint/tree/master"
- },
- "install-path": "../kint-php/kint"
- },
- {
- "name": "npm-asset/js-cookie",
- "version": "2.1.3",
- "version_normalized": "2.1.3.0",
- "dist": {
- "type": "tar",
- "url": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.1.3.tgz"
+ "issues": "https://github.com/reactphp/dns/issues",
+ "source": "https://github.com/reactphp/dns/tree/v1.13.0"
},
- "type": "npm-asset",
- "installation-source": "dist",
- "license": [
- "MIT"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
],
- "install-path": "../npm-asset/js-cookie"
+ "install-path": "../react/dns"
},
{
- "name": "php-cs-fixer/diff",
- "version": "v2.0.2",
- "version_normalized": "2.0.2.0",
+ "name": "react/event-loop",
+ "version": "v1.5.0",
+ "version_normalized": "1.5.0.0",
"source": {
"type": "git",
- "url": "https://github.com/PHP-CS-Fixer/diff.git",
- "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3"
+ "url": "https://github.com/reactphp/event-loop.git",
+ "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3",
- "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3",
+ "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354",
+ "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354",
"shasum": ""
},
"require": {
- "php": "^5.6 || ^7.0 || ^8.0"
+ "php": ">=5.3.0"
},
"require-dev": {
- "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0",
- "symfony/process": "^3.3"
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
},
- "time": "2020-10-14T08:32:19+00:00",
+ "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": {
- "classmap": [
- "src/"
- ]
+ "psr-4": {
+ "React\\EventLoop\\": "src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
},
{
- "name": "Kore Nordmann",
- "email": "mail@kore-nordmann.de"
+ "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": "sebastian/diff v3 backport support for PHP 5.6+",
- "homepage": "https://github.com/PHP-CS-Fixer",
+ "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.",
"keywords": [
- "diff"
+ "asynchronous",
+ "event-loop"
],
"support": {
- "issues": "https://github.com/PHP-CS-Fixer/diff/issues",
- "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2"
+ "issues": "https://github.com/reactphp/event-loop/issues",
+ "source": "https://github.com/reactphp/event-loop/tree/v1.5.0"
},
- "install-path": "../php-cs-fixer/diff"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "install-path": "../react/event-loop"
},
{
- "name": "psr/cache",
- "version": "1.0.1",
- "version_normalized": "1.0.1.0",
+ "name": "react/promise",
+ "version": "v3.2.0",
+ "version_normalized": "3.2.0.0",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/cache.git",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
+ "url": "https://github.com/reactphp/promise.git",
+ "reference": "8a164643313c71354582dc850b42b33fa12a4b63"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63",
+ "reference": "8a164643313c71354582dc850b42b33fa12a4b63",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=7.1.0"
},
- "time": "2016-08-06T20:24:11+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
+ "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": {
- "Psr\\Cache\\": "src/"
+ "React\\Promise\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -759,45 +1215,78 @@
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "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": "Common interface for caching libraries",
+ "description": "A lightweight implementation of CommonJS Promises/A for PHP",
"keywords": [
- "cache",
- "psr",
- "psr-6"
+ "promise",
+ "promises"
],
"support": {
- "source": "https://github.com/php-fig/cache/tree/master"
+ "issues": "https://github.com/reactphp/promise/issues",
+ "source": "https://github.com/reactphp/promise/tree/v3.2.0"
},
- "install-path": "../psr/cache"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "install-path": "../react/promise"
},
{
- "name": "psr/container",
- "version": "1.1.2",
- "version_normalized": "1.1.2.0",
+ "name": "react/socket",
+ "version": "v1.16.0",
+ "version_normalized": "1.16.0.0",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/container.git",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
+ "url": "https://github.com/reactphp/socket.git",
+ "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
+ "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1",
+ "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1",
"shasum": ""
},
"require": {
- "php": ">=7.4.0"
+ "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"
},
- "time": "2021-11-05T16:50:12+00:00",
+ "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": {
- "Psr\\Container\\": "src/"
+ "React\\Socket\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -806,54 +1295,76 @@
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
+ "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": "Common Container Interface (PHP FIG PSR-11)",
- "homepage": "https://github.com/php-fig/container",
+ "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP",
"keywords": [
- "PSR-11",
- "container",
- "container-interface",
- "container-interop",
- "psr"
+ "Connection",
+ "Socket",
+ "async",
+ "reactphp",
+ "stream"
],
"support": {
- "issues": "https://github.com/php-fig/container/issues",
- "source": "https://github.com/php-fig/container/tree/1.1.2"
+ "issues": "https://github.com/reactphp/socket/issues",
+ "source": "https://github.com/reactphp/socket/tree/v1.16.0"
},
- "install-path": "../psr/container"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "install-path": "../react/socket"
},
{
- "name": "psr/event-dispatcher",
- "version": "1.0.0",
- "version_normalized": "1.0.0.0",
+ "name": "react/stream",
+ "version": "v1.4.0",
+ "version_normalized": "1.4.0.0",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/event-dispatcher.git",
- "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0"
+ "url": "https://github.com/reactphp/stream.git",
+ "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0",
- "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0",
+ "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d",
+ "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d",
"shasum": ""
},
"require": {
- "php": ">=7.2.0"
+ "evenement/evenement": "^3.0 || ^2.0 || ^1.0",
+ "php": ">=5.3.8",
+ "react/event-loop": "^1.2"
},
- "time": "2019-01-08T18:20:26+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
+ "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": {
- "Psr\\EventDispatcher\\": "src/"
+ "React\\Stream\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -862,74 +1373,117 @@
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "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": "Standard interfaces for event handling.",
+ "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP",
"keywords": [
- "events",
- "psr",
- "psr-14"
+ "event-driven",
+ "io",
+ "non-blocking",
+ "pipe",
+ "reactphp",
+ "readable",
+ "stream",
+ "writable"
],
"support": {
- "issues": "https://github.com/php-fig/event-dispatcher/issues",
- "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0"
+ "issues": "https://github.com/reactphp/stream/issues",
+ "source": "https://github.com/reactphp/stream/tree/v1.4.0"
},
- "install-path": "../psr/event-dispatcher"
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "install-path": "../react/stream"
},
{
- "name": "psr/log",
- "version": "1.1.4",
- "version_normalized": "1.1.4.0",
+ "name": "sebastian/diff",
+ "version": "4.0.6",
+ "version_normalized": "4.0.6.0",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc",
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=7.3"
},
- "time": "2021-05-03T11:20:27+00:00",
+ "require-dev": {
+ "phpunit/phpunit": "^9.3",
+ "symfony/process": "^4.2 || ^5"
+ },
+ "time": "2024-03-02T06:30:58+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "4.0-dev"
}
},
"installation-source": "dist",
"autoload": {
- "psr-4": {
- "Psr\\Log\\": "Psr/Log/"
- }
+ "classmap": [
+ "src/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "BSD-3-Clause"
],
"authors": [
{
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
}
],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
"keywords": [
- "log",
- "psr",
- "psr-3"
+ "diff",
+ "udiff",
+ "unidiff",
+ "unified diff"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/1.1.4"
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6"
},
- "install-path": "../psr/log"
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "install-path": "../sebastian/diff"
},
{
"name": "symfony/console",
@@ -1736,17 +2290,17 @@
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.25.0",
- "version_normalized": "1.25.0.0",
+ "version": "v1.30.0",
+ "version_normalized": "1.30.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
+ "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
- "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c",
+ "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c",
"shasum": ""
},
"require": {
@@ -1758,12 +2312,9 @@
"suggest": {
"ext-mbstring": "For best performance"
},
- "time": "2021-11-30T18:21:41+00:00",
+ "time": "2024-06-19T12:30:46+00:00",
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -1802,7 +2353,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0"
},
"funding": [
{
@@ -1904,28 +2455,25 @@
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.25.0",
- "version_normalized": "1.25.0.0",
+ "version": "v1.30.0",
+ "version_normalized": "1.30.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
+ "reference": "77fa7995ac1b21ab60769b7323d600a991a90433"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
- "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433",
+ "reference": "77fa7995ac1b21ab60769b7323d600a991a90433",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
- "time": "2022-03-04T08:16:47+00:00",
+ "time": "2024-05-31T15:07:36+00:00",
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -1970,7 +2518,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0"
},
"funding": [
{
@@ -1990,28 +2538,25 @@
},
{
"name": "symfony/polyfill-php81",
- "version": "v1.25.0",
- "version_normalized": "1.25.0.0",
+ "version": "v1.30.0",
+ "version_normalized": "1.30.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f"
+ "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
- "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af",
+ "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
- "time": "2021-09-13T13:58:11+00:00",
+ "time": "2024-06-19T12:30:46+00:00",
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -2052,7 +2597,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0"
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0"
},
"funding": [
{
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index ad984f6840..44abb162b2 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -1,148 +1,139 @@
array(
+ 'name' => 'opencaching/opencaching.pl',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
+ 'reference' => '2bd9164a70851e8dad1397be99d4aa56c9c95fc4',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
- 'reference' => 'a220537ea4a6443509efa79db721feb191a83cd2',
- 'name' => 'opencaching/opencaching.pl',
'dev' => true,
),
'versions' => array(
'aferrandini/phpqrcode' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
+ 'reference' => '3c1c0454d43710ab5bbe19a51ad4cb41c22e3d46',
'type' => 'library',
'install_path' => __DIR__ . '/../aferrandini/phpqrcode',
'aliases' => array(),
- 'reference' => '3c1c0454d43710ab5bbe19a51ad4cb41c22e3d46',
+ '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.0.0',
'version' => '3.0.0.0',
+ 'reference' => 'e300eb6c535192decd27a85bc72a9290f0d6b3bd',
'type' => 'library',
'install_path' => __DIR__ . '/./pcre',
'aliases' => array(),
- 'reference' => 'e300eb6c535192decd27a85bc72a9290f0d6b3bd',
'dev_requirement' => false,
),
'composer/semver' => array(
- 'pretty_version' => '3.3.1',
- 'version' => '3.3.1.0',
+ 'pretty_version' => '3.4.2',
+ 'version' => '3.4.2.0',
+ 'reference' => 'c51258e759afdb17f1fd1fe83bc12baaef6309d6',
'type' => 'library',
'install_path' => __DIR__ . '/./semver',
'aliases' => array(),
- 'reference' => '5d8e574bb0e69188786b8ef77d43341222a41a71',
'dev_requirement' => false,
),
'composer/xdebug-handler' => array(
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/./xdebug-handler',
- 'aliases' => array(),
'reference' => 'ced299686f41dce890debac69273b47ffe98a40c',
- 'dev_requirement' => false,
- ),
- 'doctrine/annotations' => array(
- 'pretty_version' => '1.13.2',
- 'version' => '1.13.2.0',
'type' => 'library',
- 'install_path' => __DIR__ . '/../doctrine/annotations',
+ 'install_path' => __DIR__ . '/./xdebug-handler',
'aliases' => array(),
- 'reference' => '5b668aef16090008790395c02c893b1ba13f7e08',
'dev_requirement' => false,
),
- 'doctrine/lexer' => array(
- 'pretty_version' => '1.2.3',
- 'version' => '1.2.3.0',
+ 'evenement/evenement' => array(
+ 'pretty_version' => 'v3.0.2',
+ 'version' => '3.0.2.0',
+ 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc',
'type' => 'library',
- 'install_path' => __DIR__ . '/../doctrine/lexer',
+ 'install_path' => __DIR__ . '/../evenement/evenement',
'aliases' => array(),
- 'reference' => 'c268e882d4dbdd85e36e4ad69e02dc284f89d229',
'dev_requirement' => false,
),
'ezyang/htmlpurifier' => array(
'pretty_version' => 'v4.14.0',
'version' => '4.14.0.0',
+ 'reference' => '12ab42bd6e742c70c0a52f7b82477fcd44e64b75',
'type' => 'library',
'install_path' => __DIR__ . '/../ezyang/htmlpurifier',
'aliases' => array(),
- 'reference' => '12ab42bd6e742c70c0a52f7b82477fcd44e64b75',
+ 'dev_requirement' => false,
+ ),
+ 'fidry/cpu-core-counter' => array(
+ 'pretty_version' => '1.1.0',
+ 'version' => '1.1.0.0',
+ 'reference' => 'f92996c4d5c1a696a6a970e20f7c4216200fcc42',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../fidry/cpu-core-counter',
+ 'aliases' => array(),
'dev_requirement' => false,
),
'friendsofphp/php-cs-fixer' => array(
- 'pretty_version' => 'v3.8.0',
- 'version' => '3.8.0.0',
+ 'pretty_version' => 'v3.61.1',
+ 'version' => '3.61.1.0',
+ 'reference' => '94a87189f55814e6cabca2d9a33b06de384a2ab8',
'type' => 'application',
'install_path' => __DIR__ . '/../friendsofphp/php-cs-fixer',
'aliases' => array(),
- 'reference' => 'cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3',
'dev_requirement' => false,
),
'kint-php/kint' => array(
'pretty_version' => '3.3',
'version' => '3.3.0.0',
+ 'reference' => '335ac1bcaf04d87df70d8aa51e8887ba2c6d203b',
'type' => 'library',
'install_path' => __DIR__ . '/../kint-php/kint',
'aliases' => array(),
- 'reference' => '335ac1bcaf04d87df70d8aa51e8887ba2c6d203b',
'dev_requirement' => false,
),
'npm-asset/js-cookie' => array(
'pretty_version' => '2.1.3',
'version' => '2.1.3.0',
+ 'reference' => null,
'type' => 'npm-asset',
'install_path' => __DIR__ . '/../npm-asset/js-cookie',
'aliases' => array(),
- 'reference' => NULL,
'dev_requirement' => false,
),
'opencaching/opencaching.pl' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
+ 'reference' => '2bd9164a70851e8dad1397be99d4aa56c9c95fc4',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
- 'reference' => 'a220537ea4a6443509efa79db721feb191a83cd2',
- 'dev_requirement' => false,
- ),
- 'php-cs-fixer/diff' => array(
- 'pretty_version' => 'v2.0.2',
- 'version' => '2.0.2.0',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../php-cs-fixer/diff',
- 'aliases' => array(),
- 'reference' => '29dc0d507e838c4580d018bd8b5cb412474f7ec3',
- 'dev_requirement' => false,
- ),
- 'psr/cache' => array(
- 'pretty_version' => '1.0.1',
- 'version' => '1.0.1.0',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../psr/cache',
- 'aliases' => array(),
- 'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
'dev_requirement' => false,
),
'psr/container' => array(
'pretty_version' => '1.1.2',
'version' => '1.1.2.0',
+ 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/container',
'aliases' => array(),
- 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
'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(
@@ -154,10 +145,10 @@
'psr/log' => array(
'pretty_version' => '1.1.4',
'version' => '1.1.4.0',
+ 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
- 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
'dev_requirement' => false,
),
'psr/log-implementation' => array(
@@ -166,40 +157,112 @@
0 => '1.0|2.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.5',
+ 'version' => '0.6.5.0',
+ 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43',
+ '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' => '4.0.6',
+ 'version' => '4.0.6.0',
+ 'reference' => 'ba01945089c3a293b01ba9badc29ad55b106b0bc',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../sebastian/diff',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
'symfony/console' => array(
'pretty_version' => 'v5.4.5',
'version' => '5.4.5.0',
+ 'reference' => 'd8111acc99876953f52fe16d4c50eb60940d49ad',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/console',
'aliases' => array(),
- 'reference' => 'd8111acc99876953f52fe16d4c50eb60940d49ad',
'dev_requirement' => false,
),
'symfony/deprecation-contracts' => array(
'pretty_version' => 'v2.5.0',
'version' => '2.5.0.0',
+ 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
'aliases' => array(),
- 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8',
'dev_requirement' => false,
),
'symfony/event-dispatcher' => array(
'pretty_version' => 'v5.4.3',
'version' => '5.4.3.0',
+ 'reference' => 'dec8a9f58d20df252b9cd89f1c6c1530f747685d',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/event-dispatcher',
'aliases' => array(),
- 'reference' => 'dec8a9f58d20df252b9cd89f1c6c1530f747685d',
'dev_requirement' => false,
),
'symfony/event-dispatcher-contracts' => array(
'pretty_version' => 'v2.5.0',
'version' => '2.5.0.0',
+ 'reference' => '66bea3b09be61613cd3b4043a65a8ec48cfa6d2a',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts',
'aliases' => array(),
- 'reference' => '66bea3b09be61613cd3b4043a65a8ec48cfa6d2a',
'dev_requirement' => false,
),
'symfony/event-dispatcher-implementation' => array(
@@ -211,127 +274,127 @@
'symfony/filesystem' => array(
'pretty_version' => 'v5.4.6',
'version' => '5.4.6.0',
+ 'reference' => 'd53a45039974952af7f7ebc461ccdd4295e29440',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/filesystem',
'aliases' => array(),
- 'reference' => 'd53a45039974952af7f7ebc461ccdd4295e29440',
'dev_requirement' => false,
),
'symfony/finder' => array(
'pretty_version' => 'v5.4.3',
'version' => '5.4.3.0',
+ 'reference' => '231313534dded84c7ecaa79d14bc5da4ccb69b7d',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/finder',
'aliases' => array(),
- 'reference' => '231313534dded84c7ecaa79d14bc5da4ccb69b7d',
'dev_requirement' => false,
),
'symfony/options-resolver' => array(
'pretty_version' => 'v5.4.3',
'version' => '5.4.3.0',
+ 'reference' => 'cc1147cb11af1b43f503ac18f31aa3bec213aba8',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/options-resolver',
'aliases' => array(),
- 'reference' => 'cc1147cb11af1b43f503ac18f31aa3bec213aba8',
'dev_requirement' => false,
),
'symfony/polyfill-ctype' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
+ 'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
'aliases' => array(),
- 'reference' => '30885182c981ab175d4d034db0f6f469898070ab',
'dev_requirement' => false,
),
'symfony/polyfill-intl-grapheme' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
+ 'reference' => '81b86b50cf841a64252b439e738e97f4a34e2783',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme',
'aliases' => array(),
- 'reference' => '81b86b50cf841a64252b439e738e97f4a34e2783',
'dev_requirement' => false,
),
'symfony/polyfill-intl-normalizer' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
+ 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',
'aliases' => array(),
- 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8',
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
- 'pretty_version' => 'v1.25.0',
- 'version' => '1.25.0.0',
+ 'pretty_version' => 'v1.30.0',
+ 'version' => '1.30.0.0',
+ 'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
- 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825',
'dev_requirement' => false,
),
'symfony/polyfill-php73' => array(
'pretty_version' => 'v1.25.0',
'version' => '1.25.0.0',
+ 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php73',
'aliases' => array(),
- 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5',
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
- 'pretty_version' => 'v1.25.0',
- 'version' => '1.25.0.0',
+ 'pretty_version' => 'v1.30.0',
+ 'version' => '1.30.0.0',
+ 'reference' => '77fa7995ac1b21ab60769b7323d600a991a90433',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),
- 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c',
'dev_requirement' => false,
),
'symfony/polyfill-php81' => array(
- 'pretty_version' => 'v1.25.0',
- 'version' => '1.25.0.0',
+ 'pretty_version' => 'v1.30.0',
+ 'version' => '1.30.0.0',
+ 'reference' => '3fb075789fb91f9ad9af537c4012d523085bd5af',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php81',
'aliases' => array(),
- 'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f',
'dev_requirement' => false,
),
'symfony/process' => array(
'pretty_version' => 'v5.4.5',
'version' => '5.4.5.0',
+ 'reference' => '95440409896f90a5f85db07a32b517ecec17fa4c',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/process',
'aliases' => array(),
- 'reference' => '95440409896f90a5f85db07a32b517ecec17fa4c',
'dev_requirement' => false,
),
'symfony/service-contracts' => array(
'pretty_version' => 'v2.5.0',
'version' => '2.5.0.0',
+ 'reference' => '1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/service-contracts',
'aliases' => array(),
- 'reference' => '1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc',
'dev_requirement' => false,
),
'symfony/stopwatch' => array(
'pretty_version' => 'v5.4.5',
'version' => '5.4.5.0',
+ 'reference' => '4d04b5c24f3c9a1a168a131f6cbe297155bc0d30',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/stopwatch',
'aliases' => array(),
- 'reference' => '4d04b5c24f3c9a1a168a131f6cbe297155bc0d30',
'dev_requirement' => false,
),
'symfony/string' => array(
'pretty_version' => 'v5.4.3',
'version' => '5.4.3.0',
+ 'reference' => '92043b7d8383e48104e411bc9434b260dbeb5a10',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/string',
'aliases' => array(),
- 'reference' => '92043b7d8383e48104e411bc9434b260dbeb5a10',
'dev_requirement' => false,
),
),
diff --git a/vendor/composer/semver/CHANGELOG.md b/vendor/composer/semver/CHANGELOG.md
index b61f0dff9d..7e44191440 100644
--- a/vendor/composer/semver/CHANGELOG.md
+++ b/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.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)
@@ -171,6 +187,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.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
diff --git a/vendor/composer/semver/README.md b/vendor/composer/semver/README.md
index 99bc46151f..7677849065 100644
--- a/vendor/composer/semver/README.md
+++ b/vendor/composer/semver/README.md
@@ -1,13 +1,14 @@
composer/semver
===============
-Semver library that offers utilities, version constraint parsing and validation.
+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/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/vendor/composer/semver/composer.json b/vendor/composer/semver/composer.json
index ba78676ddc..f3a6f4cc68 100644
--- a/vendor/composer/semver/composer.json
+++ b/vendor/composer/semver/composer.json
@@ -27,7 +27,7 @@
}
],
"support": {
- "irc": "irc://irc.freenode.org/composer",
+ "irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues"
},
"require": {
diff --git a/vendor/composer/semver/src/VersionParser.php b/vendor/composer/semver/src/VersionParser.php
index 1754a76378..305a0faec1 100644
--- a/vendor/composer/semver/src/VersionParser.php
+++ b/vendor/composer/semver/src/VersionParser.php
@@ -51,7 +51,7 @@ class VersionParser
*/
public static function parseStability($version)
{
- $version = (string) preg_replace('{#.+$}', '', $version);
+ $version = (string) preg_replace('{#.+$}', '', (string) $version);
if (strpos($version, 'dev-') === 0 || '-dev' === substr($version, -4)) {
return 'dev';
@@ -82,10 +82,15 @@ public static function parseStability($version)
* @param string $stability
*
* @return string
+ * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev'
*/
public static function normalizeStability($stability)
{
- $stability = strtolower($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;
}
@@ -94,7 +99,7 @@ public static function normalizeStability($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
+ * @param ?string $fullVersion optional complete version string to give more context
*
* @throws \UnexpectedValueException
*
@@ -102,7 +107,7 @@ public static function normalizeStability($stability)
*/
public function normalize($version, $fullVersion = null)
{
- $version = trim($version);
+ $version = trim((string) $version);
$origVersion = $version;
if (null === $fullVersion) {
$fullVersion = $version;
@@ -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;
}
@@ -195,7 +200,7 @@ public function normalize($version, $fullVersion = null)
*/
public function parseNumericAliasPrefix($branch)
{
- if (preg_match('{^(?P(\d++\\.)*\d++)(?:\.x)?-dev$}i', $branch, $matches)) {
+ if (preg_match('{^(?P(\d++\\.)*\d++)(?:\.x)?-dev$}i', (string) $branch, $matches)) {
return $matches['version'] . '.';
}
@@ -211,7 +216,7 @@ public function parseNumericAliasPrefix($branch)
*/
public function normalizeBranch($name)
{
- $name = trim($name);
+ $name = trim((string) $name);
if (preg_match('{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i', $name, $matches)) {
$version = '';
@@ -231,6 +236,8 @@ public function normalizeBranch($name)
* @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)
{
@@ -238,7 +245,7 @@ public function normalizeDefaultBranch($name)
return '9999999-dev';
}
- return $name;
+ return (string) $name;
}
/**
@@ -250,24 +257,24 @@ public function normalizeDefaultBranch($name)
*/
public function parseConstraints($constraints)
{
- $prettyConstraint = $constraints;
+ $prettyConstraint = (string) $constraints;
- $orConstraints = preg_split('{\s*\|\|?\s*}', trim($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 $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 {
@@ -283,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/vendor/doctrine/annotations/README.md b/vendor/doctrine/annotations/README.md
deleted file mode 100644
index c2c7eb7bad..0000000000
--- a/vendor/doctrine/annotations/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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/vendor/doctrine/annotations/composer.json b/vendor/doctrine/annotations/composer.json
deleted file mode 100644
index 00d0231075..0000000000
--- a/vendor/doctrine/annotations/composer.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "name": "doctrine/annotations",
- "type": "library",
- "description": "Docblock Annotations Parser",
- "keywords": ["annotations", "docblock", "parser"],
- "homepage": "https://www.doctrine-project.org/projects/annotations.html",
- "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"}
- ],
- "require": {
- "php": "^7.1 || ^8.0",
- "ext-tokenizer": "*",
- "doctrine/lexer": "1.*",
- "psr/cache": "^1 || ^2 || ^3"
- },
- "require-dev": {
- "doctrine/cache": "^1.11 || ^2.0",
- "doctrine/coding-standard": "^6.0 || ^8.1",
- "phpstan/phpstan": "^0.12.20",
- "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5",
- "symfony/cache": "^4.4 || ^5.2"
- },
- "config": {
- "sort-packages": true
- },
- "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"
- ]
- }
-}
diff --git a/vendor/doctrine/annotations/docs/en/annotations.rst b/vendor/doctrine/annotations/docs/en/annotations.rst
deleted file mode 100644
index 2c3c428654..0000000000
--- a/vendor/doctrine/annotations/docs/en/annotations.rst
+++ /dev/null
@@ -1,252 +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;
- use Doctrine\Common\Annotations\AnnotationRegistry;
-
- AnnotationRegistry::registerFile("/path/to/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
- AnnotationRegistry::registerAutoloadNamespace("Symfony\Component\Validator\Constraint", "/path/to/symfony/src");
- AnnotationRegistry::registerAutoloadNamespace("MyProject\Annotations", "/path/to/myproject/src");
-
- $reader = new AnnotationReader();
- AnnotationReader::addGlobalIgnoredName('dummy');
-
-The second block with the annotation registry calls registers all the
-three different annotation namespaces that are used.
-Doctrine Annotations saves all its annotations in a single file, that is
-why ``AnnotationRegistry#registerFile`` is used in contrast to
-``AnnotationRegistry#registerAutoloadNamespace`` which creates a PSR-0
-compatible loading mechanism for class to file names.
-
-In the third block, 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.
-
-Registering Annotations
-~~~~~~~~~~~~~~~~~~~~~~~
-
-As explained in the introduction, Doctrine Annotations uses its own
-autoloading mechanism to determine if a given annotation has a
-corresponding PHP class that can be autoloaded. For annotation
-autoloading you have to configure the
-``Doctrine\Common\Annotations\AnnotationRegistry``. There are three
-different mechanisms to configure annotation autoloading:
-
-- Calling ``AnnotationRegistry#registerFile($file)`` to register a file
- that contains one or more annotation classes.
-- Calling ``AnnotationRegistry#registerNamespace($namespace, $dirs =
- null)`` to register that the given namespace contains annotations and
- that their base directory is located at the given $dirs or in the
- include path if ``NULL`` is passed. The given directories should *NOT*
- be the directory where classes of the namespace are in, but the base
- directory of the root namespace. The AnnotationRegistry uses a
- namespace to directory separator approach to resolve the correct path.
-- Calling ``AnnotationRegistry#registerLoader($callable)`` to register
- an autoloader callback. The callback accepts the class as first and
- only parameter and has to return ``true`` if the corresponding file
- was found and included.
-
-.. note::
-
- Loaders have to fail silently, if a class is not found even if it
- matches for example the namespace prefix of that loader. Never is a
- loader to throw a warning or exception if the loading failed
- otherwise parsing doc block annotations will become a huge pain.
-
-A sample loader callback could look like:
-
-.. code-block:: php
-
- use Doctrine\Common\Annotations\AnnotationRegistry;
- use Symfony\Component\ClassLoader\UniversalClassLoader;
-
- AnnotationRegistry::registerLoader(function($class) {
- $file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php";
-
- if (file_exists("/my/base/path/" . $file)) {
- // file_exists() makes sure that the loader fails silently
- require "/my/base/path/" . $file;
- }
- });
-
- $loader = new UniversalClassLoader();
- AnnotationRegistry::registerLoader(array($loader, "loadClass"));
-
-
-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/vendor/doctrine/annotations/docs/en/custom.rst b/vendor/doctrine/annotations/docs/en/custom.rst
deleted file mode 100644
index 11fbe1a31e..0000000000
--- a/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 and register this namespace in the ``AnnotationRegistry``.
-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 ``@NamedArgumentContrustor`` 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/vendor/doctrine/annotations/docs/en/index.rst b/vendor/doctrine/annotations/docs/en/index.rst
deleted file mode 100644
index 95476c3139..0000000000
--- a/vendor/doctrine/annotations/docs/en/index.rst
+++ /dev/null
@@ -1,101 +0,0 @@
-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;
- use Doctrine\Common\Annotations\AnnotationRegistry;
-
- // Deprecated and will be removed in 2.0 but currently needed
- AnnotationRegistry::registerLoader('class_exists');
-
- $reflectionClass = new ReflectionClass(Foo::class);
- $property = $reflectionClass->getProperty('bar');
-
- $reader = new AnnotationReader();
- $myAnnotation = $reader->getPropertyAnnotation(
- $property,
- MyAnnotation::class
- );
-
- echo $myAnnotation->myProperty; // result: "value"
-
-Note that ``AnnotationRegistry::registerLoader('class_exists')`` only works
-if you already have an autoloader configured (i.e. composer autoloader).
-Otherwise, :ref:`please take a look to the other annotation autoload mechanisms `.
-
-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/vendor/doctrine/annotations/docs/en/sidebar.rst b/vendor/doctrine/annotations/docs/en/sidebar.rst
deleted file mode 100644
index 6f5d13c46a..0000000000
--- a/vendor/doctrine/annotations/docs/en/sidebar.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-.. toctree::
- :depth: 3
-
- index
- annotations
- custom
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php
deleted file mode 100644
index 750270e425..0000000000
--- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php
+++ /dev/null
@@ -1,59 +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.
- *
- * @param string $name Unknown property name.
- *
- * @throws BadMethodCallException
- */
- public function __get($name)
- {
- throw new BadMethodCallException(
- sprintf("Unknown property '%s' on annotation '%s'.", $name, static::class)
- );
- }
-
- /**
- * Error handler for unknown property mutator in Annotation class.
- *
- * @param string $name Unknown property name.
- * @param mixed $value Property value.
- *
- * @throws BadMethodCallException
- */
- public function __set($name, $value)
- {
- throw new BadMethodCallException(
- sprintf("Unknown property '%s' on annotation '%s'.", $name, static::class)
- );
- }
-}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php
deleted file mode 100644
index b1f8514005..0000000000
--- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php
+++ /dev/null
@@ -1,21 +0,0 @@
- */
- public $value;
-}
diff --git a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php
deleted file mode 100644
index 35d6410b10..0000000000
--- a/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;
-
- /**
- * @throws InvalidArgumentException
- *
- * @phpstan-param array{literal?: mixed[], value: list} $values
- */
- 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/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
deleted file mode 100644
index ae60f7d5b0..0000000000
--- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
+++ /dev/null
@@ -1,43 +0,0 @@
- */
- public $names;
-
- /**
- * @throws RuntimeException
- *
- * @phpstan-param array{value: string|list} $values
- */
- 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/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/NamedArgumentConstructor.php
deleted file mode 100644
index 1690601037..0000000000
--- a/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;
-
- /**
- * @throws InvalidArgumentException
- *
- * @phpstan-param array{value?: string|list} $values
- */
- 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/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php
deleted file mode 100644
index b1ea64e6f5..0000000000
--- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php
+++ /dev/null
@@ -1,171 +0,0 @@
- $available
- */
- public static function enumeratorError($attributeName, $annotationName, $context, $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/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php b/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php
deleted file mode 100644
index 1f538ee534..0000000000
--- a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php
+++ /dev/null
@@ -1,389 +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.
- *
- * @param string $name
- */
- public static function addGlobalIgnoredName($name)
- {
- self::$globalIgnoredNames[$name] = true;
- }
-
- /**
- * Add a new annotation to the globally ignored annotation namespaces with regard to exception handling.
- *
- * @param string $namespace
- */
- public static function addGlobalIgnoredNamespace($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
-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.,
@@ -19,6 +18,22 @@ 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
@@ -28,20 +43,40 @@ in a dedicated `composer.json` file in your project, for example in the
`tools/php-cs-fixer` directory:
```console
-$ mkdir --parents tools/php-cs-fixer
-$ composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer
+mkdir -p tools/php-cs-fixer
+composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer
+```
+
+Or using the main `composer.json`:
+
+```console
+composer require --dev friendsofphp/php-cs-fixer
```
For more details and other installation methods, see
[installation instructions](./doc/installation.rst).
+### Run with Docker
+
+You can use pre-built Docker images to run ``php-cs-fixer``.
+
+```console
+docker run -it --rm -v $(pwd):/code ghcr.io/php-cs-fixer/php-cs-fixer:${FIXER_VERSION:-3-php8.3} fix src
+```
+
+`$FIXER_VERSION` used in example above is an identifier of a release you want to use, which is based on Fixer and PHP versions combined. There are different tags for each Fixer's SemVer level and PHP version with syntax `-php`. For example:
+
+* `3.57.0-php7.4`
+* `3.57-php8.0`
+* `3-php8.3`
+
### 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
+tools/php-cs-fixer/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)
@@ -54,7 +89,6 @@ If you need to apply code styles that are not supported by the tool, you can
Dedicated plugins exist for:
-* [Atom](https://github.com/Glavin001/atom-beautify)
* [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)
@@ -63,11 +97,11 @@ Dedicated plugins exist for:
## Community
-The PHP CS Fixer is maintained on GitHub at https://github.com/FriendsOfPHP/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/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md b/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md
index c295a57cd5..bea1ff4fba 100644
--- a/vendor/friendsofphp/php-cs-fixer/UPGRADE-v3.md
+++ b/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/FriendsOfPHP/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.*
+*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/vendor/friendsofphp/php-cs-fixer/ci-integration.sh b/vendor/friendsofphp/php-cs-fixer/ci-integration.sh
index 2521e2494c..39d999559b 100644
--- a/vendor/friendsofphp/php-cs-fixer/ci-integration.sh
+++ b/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/vendor/friendsofphp/php-cs-fixer/composer.json b/vendor/friendsofphp/php-cs-fixer/composer.json
index 5cff2a0ba4..f106058634 100644
--- a/vendor/friendsofphp/php-cs-fixer/composer.json
+++ b/vendor/friendsofphp/php-cs-fixer/composer.json
@@ -3,6 +3,12 @@
"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",
@@ -15,38 +21,43 @@
],
"require": {
"php": "^7.4 || ^8.0",
+ "ext-filter": "*",
"ext-json": "*",
"ext-tokenizer": "*",
- "composer/semver": "^3.2",
+ "clue/ndjson-react": "^1.0",
+ "composer/semver": "^3.4",
"composer/xdebug-handler": "^3.0.3",
- "doctrine/annotations": "^1.13",
- "php-cs-fixer/diff": "^2.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.23",
- "symfony/polyfill-php80": "^1.25",
- "symfony/polyfill-php81": "^1.25",
- "symfony/process": "^5.4 || ^6.0",
- "symfony/stopwatch": "^5.4 || ^6.0"
+ "fidry/cpu-core-counter": "^1.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.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",
+ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
+ "facile-it/paraunit": "^1.3 || ^2.3",
+ "infection/infection": "^0.29.5",
"justinrainbow/json-schema": "^5.2",
- "keradus/cli-executor": "^1.5",
- "mikey179/vfsstream": "^1.6.10",
- "php-coveralls/php-coveralls": "^2.5.2",
+ "keradus/cli-executor": "^2.1",
+ "mikey179/vfsstream": "^1.6.11",
+ "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.15",
- "phpspec/prophecy-phpunit": "^2.0",
- "phpunit/phpunit": "^9.5",
- "phpunitgoodpractices/polyfill": "^1.5",
- "phpunitgoodpractices/traits": "^1.9.1",
- "symfony/phpunit-bridge": "^6.0",
- "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.19 || ^10.5.21 || ^11.2",
+ "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
+ "symfony/yaml": "^5.4 || ^6.0 || ^7.0"
},
"suggest": {
"ext-dom": "For handling output formats in XML",
@@ -55,17 +66,136 @@
"autoload": {
"psr-4": {
"PhpCsFixer\\": "src/"
- }
+ },
+ "exclude-from-classmap": [
+ "src/Fixer/Internal/*"
+ ]
},
"autoload-dev": {
"psr-4": {
"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"
+ ],
+ "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": "Run normalization for composer.json files",
+ "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/vendor/friendsofphp/php-cs-fixer/feature-or-bug.rst b/vendor/friendsofphp/php-cs-fixer/feature-or-bug.rst
new file mode 100644
index 0000000000..e5959422cc
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/feature-or-bug.rst
@@ -0,0 +1,24 @@
+==========================
+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/vendor/friendsofphp/php-cs-fixer/logo.md b/vendor/friendsofphp/php-cs-fixer/logo.md
index c5f7b39914..68e03a582f 100644
--- a/vendor/friendsofphp/php-cs-fixer/logo.md
+++ b/vendor/friendsofphp/php-cs-fixer/logo.md
@@ -1,3 +1,3 @@
-The logo is © 2010-2022 Sensio Labs.
+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/vendor/friendsofphp/php-cs-fixer/php-cs-fixer b/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
old mode 100644
new mode 100755
index c1442aab42..402b49ae62
--- a/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
+++ b/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
@@ -21,28 +21,15 @@ set_error_handler(static function ($severity, $message, $file, $line) {
// check environment requirements
(function () {
- if (defined('HHVM_VERSION_ID')) {
- fwrite(STDERR, "HHVM is not supported.\n");
-
- if (getenv('PHP_CS_FIXER_IGNORE_ENV')) {
- fwrite(STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n");
- } else {
- exit(1);
- }
- } elseif (!defined('PHP_VERSION_ID')) { // PHP_VERSION_ID is available as of PHP 5.2.7
- fwrite(STDERR, 'PHP version no supported, please update. Current PHP version: '.PHP_VERSION.".\n");
-
- exit(1);
- } elseif (\PHP_VERSION_ID === 80000) {
+ if (\PHP_VERSION_ID === 80000) {
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);
- } elseif (
- \PHP_VERSION_ID < 70400
- || \PHP_VERSION_ID >= 80200
- ) {
- fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.1.*.\n");
+ }
+
+ if (\PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 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')) {
@@ -50,7 +37,7 @@ set_error_handler(static function ($severity, $message, $file, $line) {
} 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/FriendsOfPHP/PHP-CS-Fixer .\n");
+ fwrite(STDERR, "Please report such cases at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer .\n");
exit(1);
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php
index 79d64171df..7ca969fb27 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php
@@ -26,22 +26,30 @@
/**
* @internal
+ *
+ * @phpstan-type _AutogeneratedInputConfiguration array{
+ * scalar_types?: bool,
+ * union_types?: bool
+ * }
+ * @phpstan-type _AutogeneratedComputedConfiguration array{
+ * scalar_types: bool,
+ * union_types: bool
+ * }
+ *
+ * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
*/
abstract class AbstractDoctrineAnnotationFixer extends AbstractFixer implements ConfigurableFixerInterface
{
- private array $classyElements;
-
/**
- * {@inheritdoc}
+ * @var array
*/
+ private array $classyElements;
+
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
@@ -56,7 +64,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);
@@ -69,23 +77,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',
@@ -204,13 +200,19 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
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([T_ABSTRACT, T_FINAL]));
+ } while ($tokens[$index]->isGivenKind($classModifiers));
if ($tokens[$index]->isGivenKind(T_CLASS)) {
return true;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php
index 3b29809e63..fd193f410a 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php
+++ b/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,21 +27,11 @@
*/
abstract class AbstractFixer implements FixerInterface
{
- /**
- * @var null|array
- */
- protected $configuration;
-
/**
* @var WhitespacesFixerConfig
*/
protected $whitespacesConfig;
- /**
- * @var null|FixerConfigurationResolverInterface
- */
- private $configurationDefinition;
-
public function __construct()
{
if ($this instanceof ConfigurableFixerInterface) {
@@ -67,7 +49,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 +58,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,81 +71,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;
}
- 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) {
@@ -181,15 +92,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/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php
index e9d7a120ce..da862da736 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php
index 350b87cf3d..dfddeb5167 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php
@@ -29,17 +29,11 @@ abstract class AbstractFunctionReferenceFixer extends AbstractFixer
*/
private $functionsAnalyzer;
- /**
- * {@inheritdoc}
- */
public function isCandidate(Tokens $tokens): bool
{
return $tokens->isTokenKindFound(T_STRING);
}
- /**
- * {@inheritdoc}
- */
public function isRisky(): bool
{
return true;
@@ -49,7 +43,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/vendor/friendsofphp/php-cs-fixer/src/AbstractLinesBeforeNamespaceFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractLinesBeforeNamespaceFixer.php
deleted file mode 100644
index f574b97040..0000000000
--- a/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/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php
index 96f6bb09f6..b45be5acdb 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php
index 1a2792f70f..174416cb19 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php
+++ b/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,19 +30,36 @@
/**
* @internal
+ *
+ * @phpstan-type _CommonTypeInfo array{commonType: string, isNullable: bool}
+ * @phpstan-type _AutogeneratedInputConfiguration array{
+ * scalar_types?: bool,
+ * union_types?: bool
+ * }
+ * @phpstan-type _AutogeneratedComputedConfiguration array{
+ * scalar_types: bool,
+ * 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
*/
private array $versionSpecificTypes = [
- 'void' => 70100,
- 'iterable' => 70100,
- 'object' => 70200,
- 'mixed' => 80000,
+ 'void' => 7_01_00,
+ 'iterable' => 7_01_00,
+ 'object' => 7_02_00,
+ 'mixed' => 8_00_00,
+ 'never' => 8_01_00,
];
/**
@@ -58,9 +77,6 @@ abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implem
*/
private static array $syntaxValidationCache = [];
- /**
- * {@inheritdoc}
- */
public function isRisky(): bool
{
return true;
@@ -68,9 +84,6 @@ public function isRisky(): bool
abstract protected function isSkippedType(string $type): bool;
- /**
- * {@inheritdoc}
- */
protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
{
return new FixerConfigurationResolver([
@@ -78,6 +91,10 @@ 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(),
]);
}
@@ -106,7 +123,7 @@ protected function findFunctionDocComment(Tokens $tokens, int $index): ?int
}
/**
- * @return Annotation[]
+ * @return list
*/
protected function getAnnotationsFromDocComment(string $name, Tokens $tokens, int $docCommentIndex): array
{
@@ -126,52 +143,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);
}
- protected function getCommonTypeFromAnnotation(Annotation $annotation, bool $isReturnType): ?array
- {
- $typesExpression = $annotation->getTypeExpression();
+ /**
+ * 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();
@@ -183,7 +201,7 @@ protected function getCommonTypeFromAnnotation(Annotation $annotation, bool $isR
return null;
}
- if ('static' === $commonType && (!$isReturnType || \PHP_VERSION_ID < 80000)) {
+ if ('static' === $commonType && (!$isReturnType || \PHP_VERSION_ID < 8_00_00)) {
$commonType = 'self';
}
@@ -199,11 +217,75 @@ protected function getCommonTypeFromAnnotation(Annotation $annotation, bool $isR
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() || '|' !== $typesExpression->getTypesGlue()) {
+ 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 [$commonType, $isNullable];
+ return implode($typesExpression->getTypesGlue(), array_unique($unionTypes));
}
final protected function isValidSyntax(string $code): bool
diff --git a/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php
index 44fa3fb7f8..82b8e57f49 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php
+++ b/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 $tags;
+ 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) {
@@ -102,27 +94,30 @@ private function fixTypes(Annotation $annotation): void
}
/**
- * @param string[] $types
+ * @param list $types
*
- * @return string[]
+ * @return list
*/
private function normalizeTypes(array $types): array
{
- foreach ($types as $index => $type) {
- $types[$index] = $this->normalizeType($type);
- }
-
- return $types;
- }
-
- /**
- * 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 array_map(
+ function (string $type): string {
+ $typeExpression = new TypeExpression($type, null, []);
+
+ $typeExpression->walkTypes(function (TypeExpression $type): void {
+ if (!$type->isUnionType()) {
+ $value = $this->normalize($type->toString());
+
+ // TODO TypeExpression should be immutable and walkTypes method should be changed to mapTypes method
+ \Closure::bind(static function () use ($type, $value): void {
+ $type->value = $value;
+ }, null, TypeExpression::class)();
+ }
+ });
+
+ return $typeExpression->toString();
+ },
+ $types
+ );
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php b/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php
index cdf5dacbcc..96eab156ad 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php
@@ -28,7 +28,7 @@ abstract class AbstractProxyFixer extends AbstractFixer
/**
* @var array
*/
- protected $proxyFixers;
+ protected array $proxyFixers = [];
public function __construct()
{
@@ -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/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php
index f39c1f8cee..29976749c0 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php
@@ -14,6 +14,8 @@
namespace PhpCsFixer\Cache;
+use PhpCsFixer\Utils;
+
/**
* @author Andreas Möller
*
@@ -24,7 +26,7 @@ final class Cache implements CacheInterface
private SignatureInterface $signature;
/**
- * @var array
+ * @var array
*/
private array $hashes = [];
@@ -43,7 +45,7 @@ public function has(string $file): bool
return \array_key_exists($file, $this->hashes);
}
- public function get(string $file): ?int
+ public function get(string $file): ?string
{
if (!$this->has($file)) {
return null;
@@ -52,7 +54,7 @@ public function get(string $file): ?int
return $this->hashes[$file];
}
- public function set(string $file, int $hash): void
+ public function set(string $file, string $hash): void
{
$this->hashes[$file] = $hash;
}
@@ -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,8 +128,24 @@ public static function fromJson(string $json): self
$cache = new self($signature);
- $cache->hashes = $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/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php
index 6b5f4bddf5..29ab719793 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php
@@ -25,9 +25,9 @@ public function getSignature(): SignatureInterface;
public function has(string $file): bool;
- public function get(string $file): ?int;
+ public function get(string $file): ?string;
- public function set(string $file, int $hash): void;
+ public function set(string $file, string $hash): void;
public function clear(string $file): void;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php
index 4e82d0c9cb..b9fb2ff635 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php
index 90882af0a0..2657389651 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php
@@ -28,9 +28,6 @@ public function __construct(string $directoryName)
$this->directoryName = $directoryName;
}
- /**
- * {@inheritdoc}
- */
public function getRelativePathTo(string $file): string
{
$file = $this->normalizePath($file);
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php
index 8d91dae7b1..d81e91c166 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php
+++ b/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,6 +44,10 @@ final class FileCacheManager implements CacheManagerInterface
private DirectoryInterface $cacheDirectory;
+ private int $writeCounter = 0;
+
+ private bool $signatureWasUpdated = false;
+
/**
* @var CacheInterface
*/
@@ -61,7 +69,9 @@ public function __construct(
public function __destruct()
{
- $this->writeCache();
+ if (true === $this->signatureWasUpdated || 0 !== $this->writeCounter) {
+ $this->writeCache();
+ }
}
/**
@@ -93,17 +103,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 +128,7 @@ private function readCache(): void
if (null === $cache || !$this->signature->equals($cache->getSignature())) {
$cache = new Cache($this->signature);
+ $this->signatureWasUpdated = true;
}
$this->cache = $cache;
@@ -122,8 +139,8 @@ private function writeCache(): void
$this->handler->write($this->cache);
}
- private function calcHash(string $content): int
+ private function calcHash(string $content): string
{
- return crc32($content);
+ return CodeHasher::calculateCodeHash($content);
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php
index 059e6b4267..a1b83ed78c 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php
index 63094804d0..3a5fe99141 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php
index 4ff463095b..48c9628989 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php
@@ -29,15 +29,21 @@ final class Signature implements SignatureInterface
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::utf8Encode($rules);
+ $this->rules = self::makeJsonEncodable($rules);
}
public function getPhpVersion(): string
@@ -74,11 +80,16 @@ public function equals(SignatureInterface $signature): bool
&& $this->rules === $signature->getRules();
}
- private static function utf8Encode(array $data): array
+ /**
+ * @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 = utf8_encode($item);
+ $item = base64_encode($item);
}
});
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php b/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php
index 062e96ddee..cc9521411e 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php
@@ -29,10 +29,10 @@ public function getIndent(): string;
public function getLineEnding(): string;
- public function getRules(): array;
-
/**
- * @param SignatureInterface $signature
+ * @return array|bool>
*/
+ public function getRules(): array;
+
public function equals(self $signature): bool;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Config.php b/vendor/friendsofphp/php-cs-fixer/src/Config.php
index 88948bfbe6..29ef94c489 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Config.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Config.php
@@ -15,25 +15,27 @@
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
{
private string $cacheFile = '.php-cs-fixer.cache';
/**
- * @var FixerInterface[]
+ * @var list
*/
private array $customFixers = [];
/**
- * @var null|iterable
+ * @var null|iterable<\SplFileInfo>
*/
- private $finder;
+ private ?iterable $finder = null;
private string $format = 'txt';
@@ -47,31 +49,46 @@ class Config implements ConfigInterface
private string $name;
+ private ParallelConfig $parallelConfig;
+
/**
* @var null|string
*/
private $phpExecutable;
- private array $rules = ['@PSR12' => true];
+ /**
+ * @TODO: 4.0 - update to @PER
+ *
+ * @var array|bool>
+ */
+ 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}
- */
public function getCacheFile(): string
{
return $this->cacheFile;
}
- /**
- * {@inheritdoc}
- */
public function getCustomFixers(): array
{
return $this->customFixers;
@@ -82,88 +99,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) {
@@ -173,9 +163,6 @@ public function registerCustomFixers(iterable $fixers): ConfigInterface
return $this;
}
- /**
- * {@inheritdoc}
- */
public function setCacheFile(string $cacheFile): ConfigInterface
{
$this->cacheFile = $cacheFile;
@@ -183,9 +170,6 @@ public function setCacheFile(string $cacheFile): ConfigInterface
return $this;
}
- /**
- * {@inheritdoc}
- */
public function setFinder(iterable $finder): ConfigInterface
{
$this->finder = $finder;
@@ -193,9 +177,6 @@ public function setFinder(iterable $finder): ConfigInterface
return $this;
}
- /**
- * {@inheritdoc}
- */
public function setFormat(string $format): ConfigInterface
{
$this->format = $format;
@@ -203,9 +184,6 @@ public function setFormat(string $format): ConfigInterface
return $this;
}
- /**
- * {@inheritdoc}
- */
public function setHideProgress(bool $hideProgress): ConfigInterface
{
$this->hideProgress = $hideProgress;
@@ -213,9 +191,6 @@ public function setHideProgress(bool $hideProgress): ConfigInterface
return $this;
}
- /**
- * {@inheritdoc}
- */
public function setIndent(string $indent): ConfigInterface
{
$this->indent = $indent;
@@ -223,9 +198,6 @@ public function setIndent(string $indent): ConfigInterface
return $this;
}
- /**
- * {@inheritdoc}
- */
public function setLineEnding(string $lineEnding): ConfigInterface
{
$this->lineEnding = $lineEnding;
@@ -233,9 +205,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;
@@ -243,9 +219,6 @@ public function setPhpExecutable(?string $phpExecutable): ConfigInterface
return $this;
}
- /**
- * {@inheritdoc}
- */
public function setRiskyAllowed(bool $isRiskyAllowed): ConfigInterface
{
$this->isRiskyAllowed = $isRiskyAllowed;
@@ -253,9 +226,6 @@ public function setRiskyAllowed(bool $isRiskyAllowed): ConfigInterface
return $this;
}
- /**
- * {@inheritdoc}
- */
public function setRules(array $rules): ConfigInterface
{
$this->rules = $rules;
@@ -263,9 +233,6 @@ public function setRules(array $rules): ConfigInterface
return $this;
}
- /**
- * {@inheritdoc}
- */
public function setUsingCache(bool $usingCache): ConfigInterface
{
$this->usingCache = $usingCache;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php b/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php
index bc16c199bf..5308f860ab 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/ConfigInterface.php
@@ -32,14 +32,14 @@ public function getCacheFile(): ?string;
/**
* Returns the custom fixers to use.
*
- * @return FixerInterface[]
+ * @return list
*/
public function getCustomFixers(): array;
/**
* Returns files to scan.
*
- * @return iterable|\Traversable
+ * @return iterable<\SplFileInfo>
*/
public function getFinder(): iterable;
@@ -77,6 +77,8 @@ 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;
@@ -90,7 +92,7 @@ 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;
@@ -99,6 +101,9 @@ public function registerCustomFixers(iterable $fixers): self;
*/
public function setCacheFile(string $cacheFile): self;
+ /**
+ * @param iterable<\SplFileInfo> $finder
+ */
public function setFinder(iterable $finder): self;
public function setFormat(string $format): self;
@@ -126,6 +131,8 @@ public function setRiskyAllowed(bool $isRiskyAllowed): self;
* 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;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidConfigurationException.php b/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidConfigurationException.php
index ab1185f09b..87babf8f7b 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidConfigurationException.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidConfigurationException.php
@@ -20,6 +20,7 @@
* Exceptions of this type are thrown on misconfiguration of the Fixer.
*
* @internal
+ *
* @final Only internal extending this class is supported
*/
class InvalidConfigurationException extends \InvalidArgumentException
diff --git a/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php b/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php
index 1419a248e2..8607bbfa44 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidFixerConfigurationException.php
@@ -20,6 +20,7 @@
* Exception thrown by Fixers on misconfiguration.
*
* @internal
+ *
* @final Only internal extending this class is supported
*/
class InvalidFixerConfigurationException extends InvalidConfigurationException
@@ -29,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/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php b/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php
index 6e4dcd4bed..440b247040 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/InvalidForEnvFixerConfigurationException.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php b/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php
index d229cda383..bcc07bdf49 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/ConfigurationException/RequiredFixerConfigurationException.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php
index 0799b7498d..36ec4fc372 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php
+++ b/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,22 @@
*/
final class Application extends BaseApplication
{
- public const VERSION = '3.8.0';
- public const VERSION_CODENAME = 'BerSzcz against war!';
+ public const NAME = 'PHP CS Fixer';
+ public const VERSION = '3.61.1';
+ public const VERSION_CODENAME = '7th Gear';
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 +67,7 @@ public function __construct()
$this->toolInfo,
new PharChecker()
));
+ $this->add(new WorkerCommand($this->toolInfo));
}
public static function getMajorVersion(): int
@@ -67,15 +75,11 @@ public static function getMajorVersion(): int
return (int) explode('.', self::VERSION)[0];
}
- /**
- * {@inheritdoc}
- */
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)
- ;
+ : ($input->hasParameterOption('--format', true) && 'txt' !== $input->getParameterOption('--format', null, true) ? null : $output);
if (null !== $stdErr) {
$warningsDetector = new WarningsDetector($this->toolInfo);
@@ -85,7 +89,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('');
}
@@ -103,7 +107,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));
}
}
}
@@ -112,10 +116,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 = '';
@@ -123,20 +129,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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.php
new file mode 100644
index 0000000000..1e7d7537f1
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/CheckCommand.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\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
+{
+ /** @var string */
+ protected static $defaultName = 'check';
+
+ /** @var string */
+ 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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php
index 07de38644c..4153c88661 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DescribeCommand.php
+++ b/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,12 +36,15 @@
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;
@@ -44,15 +53,14 @@
*
* @internal
*/
+#[AsCommand(name: 'describe')]
final class DescribeCommand extends Command
{
- /**
- * @var string
- */
+ /** @var string */
protected static $defaultName = 'describe';
/**
- * @var string[]
+ * @var ?list
*/
private $setNames;
@@ -75,31 +83,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 {
@@ -119,7 +131,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,
@@ -143,24 +155,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);
- }
+ ? \sprintf('it will be removed in version %d.0', Application::getMajorVersion() + 1)
+ : \sprintf('use %s instead', Utils::naturalLanguageJoinWithBackticks($successors));
- $output->writeln(sprintf('Description of %s rule.', $name));
-
- 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();
@@ -170,8 +186,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();
@@ -186,7 +216,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()).'';
@@ -194,30 +224,24 @@ private function describeRule(OutputInterface $output, string $name): void
if (null === $allowed) {
$allowed = array_map(
- static function (string $type): string {
- return ''.$type.'';
- },
- $option->getAllowedTypes()
+ static fn (string $type): string => ''.$type.'',
+ $option->getAllowedTypes(),
);
} else {
- foreach ($allowed as &$value) {
- if ($value instanceof AllowedValueSubset) {
- $value = 'a subset of '.HelpCommand::toString($value->getAllowedValues()).'';
- } else {
- $value = ''.HelpCommand::toString($value).'';
- }
- }
+ $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';
@@ -241,7 +265,7 @@ static function (string $type): string {
$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);
@@ -250,9 +274,14 @@ static function (string $type): string {
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 {
@@ -261,7 +290,7 @@ static function (string $type): string {
$differ = new FullDiffer();
$diffFormatter = new DiffConsoleFormatter(
$output->isDecorated(),
- sprintf(
+ \sprintf(
' ---------- begin diff ----------%s%%s%s ----------- end diff -----------',
PHP_EOL,
PHP_EOL
@@ -288,17 +317,35 @@ static function (string $type): string {
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
@@ -310,21 +357,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' : '',
@@ -338,12 +387,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)) : ''
);
}
@@ -372,7 +421,7 @@ private function getFixers(): array
}
/**
- * @return string[]
+ * @return list
*/
private function getSetNames(): array
{
@@ -390,23 +439,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));
}
}
}
@@ -415,15 +466,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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php
index 22102c0d60..e1adc98725 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/DocumentationCommand.php
@@ -16,10 +16,10 @@
use PhpCsFixer\Documentation\DocumentationLocator;
use PhpCsFixer\Documentation\FixerDocumentGenerator;
-use PhpCsFixer\Documentation\ListDocumentGenerator;
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;
@@ -30,13 +30,20 @@
/**
* @internal
*/
+#[AsCommand(name: 'documentation')]
final class DocumentationCommand extends Command
{
- /**
- * @var string
- */
+ /** @var string */
protected static $defaultName = 'documentation';
+ private Filesystem $filesystem;
+
+ public function __construct(Filesystem $filesystem)
+ {
+ parent::__construct();
+ $this->filesystem = $filesystem;
+ }
+
protected function configure(): void
{
$this
@@ -47,7 +54,6 @@ protected function configure(): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
- $filesystem = new Filesystem();
$locator = new DocumentationLocator();
$fixerFactory = new FixerFactory();
@@ -58,7 +64,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.
@@ -68,7 +73,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)
);
@@ -80,12 +85,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)
);
@@ -94,31 +99,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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php
index c3619b4e8f..45c4163cb3 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php
@@ -17,15 +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\FixerFileProcessedEvent;
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;
@@ -40,15 +45,19 @@
* @author Fabien Potencier
* @author Dariusz Rumiński
*
+ * @final
+ *
* @internal
*/
-final class FixCommand extends Command
+#[AsCommand(name: 'fix', description: 'Fixes a directory or a file.')]
+/* final */ class FixCommand extends Command
{
- /**
- * @var string
- */
+ /** @var string */
protected static $defaultName = 'fix';
+ /** @var string */
+ protected static $defaultDescription = 'Fixes a directory or a file.';
+
private EventDispatcherInterface $eventDispatcher;
private ErrorsManager $errorsManager;
@@ -59,6 +68,8 @@ final class FixCommand extends Command
private ToolInfoInterface $toolInfo;
+ private ProgressOutputFactory $progressOutputFactory;
+
public function __construct(ToolInfoInterface $toolInfo)
{
parent::__construct();
@@ -68,6 +79,7 @@ public function __construct(ToolInfoInterface $toolInfo)
$this->stopwatch = new Stopwatch();
$this->defaultConfig = new Config();
$this->toolInfo = $toolInfo;
+ $this->progressOutputFactory = new ProgressOutputFactory();
}
/**
@@ -78,139 +90,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'
- $ 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 --diff flag can be used to let the fixer output all the changes it makes.
+ The --sequential flag will enforce sequential analysis even if parallel config is provided.
-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 --diff flag can be used to let the fixer output all the changes it makes.
-The --stop-on-violation flag stops the execution upon first file that needs to be fixed.
+ 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 --show-progress option allows you to choose the way process progress is rendered:
+ The --stop-on-violation flag stops the execution upon first file that needs to be fixed.
-* none: disables progress output;
-* dots: multiline progress output with number of files and percentage on each line.
+ The --show-progress option allows you to choose the way process progress is rendered:
-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.
+ * 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.
- $ php %command.full_name% --verbose --show-progress=dots
+ 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.
-By using --using-cache option with `yes` or `no` you can set if the caching
-mechanism should be used.
+ $ php %command.full_name% --verbose --show-progress=dots
-The command can also read from standard input, in which case it won't
-automatically fix anything:
+ By using --using-cache option with `yes` or `no` you can set if the caching
+ mechanism should be used.
- $ cat foo.php | php %command.full_name% --diff -
+ The command can also read from standard input, in which case it won't
+ automatically fix anything:
-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:
+ $ cat foo.php | php %command.full_name% --diff -
- $ PHP_CS_FIXER_FUTURE_MODE=1 php %command.full_name% -v --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:
-Exit code
----------
+ $ PHP_CS_FIXER_FUTURE_MODE=1 php %command.full_name% -v --diff
-Exit code of the fix command is built using following bit flags:
+ Exit code
+ ---------
-* 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.
+ Exit code of the `%command.name%` command is built using following bit flags:
-EOF
- ;
+ * 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;
}
- /**
- * {@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();
@@ -227,7 +236,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'),
@@ -238,6 +247,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
@@ -247,63 +257,87 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$stdErr = $output instanceof ConsoleOutputInterface
? $output->getErrorOutput()
- : ('txt' === $reporter->getFormat() ? $output : null)
- ;
+ : ('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 = $resolver->getFinder();
+ $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 {
- $finder = new \ArrayIterator(iterator_to_array($finder));
- $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(FixerFileProcessedEvent::NAME, [$progressOutput, 'onFixerFileProcessed']);
$this->stopwatch->start('fixFiles');
$changed = $runner->fix();
$this->stopwatch->stop('fixFiles');
+ $this->eventDispatcher->removeListener(FixerFileProcessedEvent::NAME, [$progressOutput, 'onFixerFileProcessed']);
$progressOutput->printLegend();
@@ -311,6 +345,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$reportSummary = new ReportSummary(
$changed,
+ \count($finder),
$fixEvent->getDuration(),
$fixEvent->getMemory(),
OutputInterface::VERBOSITY_VERBOSE <= $verbosity,
@@ -320,8 +355,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->isDecorated()
? $output->write($reporter->generate($reportSummary))
- : $output->write($reporter->generate($reportSummary), false, OutputInterface::OUTPUT_RAW)
- ;
+ : $output->write($reporter->generate($reportSummary), false, OutputInterface::OUTPUT_RAW);
$invalidErrors = $this->errorsManager->getInvalidErrors();
$exceptionErrors = $this->errorsManager->getExceptionErrors();
@@ -353,4 +387,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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php
index 727dfff52b..28d6b258fb 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommandExitStatusCalculator.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php
index a5f22047c2..192c735deb 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/HelpCommand.php
@@ -16,7 +16,8 @@
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;
use Symfony\Component\Console\Input\InputInterface;
@@ -28,35 +29,23 @@
*
* @internal
*/
+#[AsCommand(name: 'help')]
final class HelpCommand extends BaseHelpCommand
{
- /**
- * @var string
- */
+ /** @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.
+ *
+ * @return null|list
*/
public static function getDisplayableAllowedValues(FixerOptionInterface $option): ?array
{
$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) {
@@ -68,8 +57,8 @@ public static function getDisplayableAllowedValues(FixerOptionInterface $option)
}
return strcasecmp(
- self::toString($valueA),
- self::toString($valueB)
+ Utils::toString($valueA),
+ Utils::toString($valueB)
);
});
@@ -81,44 +70,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);
- }
-
- 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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php
index fe21ecea1c..dcfabd093b 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListFilesCommand.php
@@ -18,22 +18,22 @@
use PhpCsFixer\ConfigInterface;
use PhpCsFixer\Console\ConfigurationResolver;
use PhpCsFixer\ToolInfoInterface;
-use SplFileInfo;
+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
{
- /**
- * @var string
- */
+ /** @var string */
protected static $defaultName = 'list-files';
private ConfigInterface $defaultConfig;
@@ -48,9 +48,6 @@ public function __construct(ToolInfoInterface $toolInfo)
$this->toolInfo = $toolInfo;
}
- /**
- * {@inheritdoc}
- */
protected function configure(): void
{
$this
@@ -79,10 +76,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$finder = $resolver->getFinder();
- /** @var SplFileInfo $file */
+ /** @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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php
index ad2a2914c3..1f7e83fb72 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/ListSetsCommand.php
@@ -20,6 +20,8 @@
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;
@@ -31,16 +33,12 @@
*
* @internal
*/
+#[AsCommand(name: 'list-sets')]
final class ListSetsCommand extends Command
{
- /**
- * @var string
- */
+ /** @var string */
protected static $defaultName = 'list-sets';
- /**
- * {@inheritdoc}
- */
protected function configure(): void
{
$this
@@ -53,7 +51,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'),
@@ -68,8 +66,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->isDecorated()
? $output->write(OutputFormatter::escape($report))
- : $output->write($report, false, OutputInterface::OUTPUT_RAW)
- ;
+ : $output->write($report, false, OutputInterface::OUTPUT_RAW);
return 0;
}
@@ -83,7 +80,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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php
index 9a3efd6ed4..229e1c8dd9 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/SelfUpdateCommand.php
@@ -14,10 +14,12 @@
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;
@@ -32,11 +34,10 @@
*
* @internal
*/
+#[AsCommand(name: 'self-update')]
final class SelfUpdateCommand extends Command
{
- /**
- * @var string
- */
+ /** @var string */
protected static $defaultName = 'self-update';
private NewVersionCheckerInterface $versionChecker;
@@ -57,9 +58,6 @@ public function __construct(
$this->pharChecker = $pharChecker;
}
- /**
- * {@inheritdoc}
- */
protected function configure(): void
{
$this
@@ -72,25 +70,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/FriendsOfPHP/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()) {
@@ -107,7 +102,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()
));
@@ -127,8 +122,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/FriendsOfPHP/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...');
@@ -141,10 +136,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;
}
@@ -153,7 +152,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;
}
@@ -163,7 +162,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;
@@ -171,7 +170,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/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php
new file mode 100644
index 0000000000..1ed2dfb4e9
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Command/WorkerCommand.php
@@ -0,0 +1,245 @@
+
+ * Dariusz 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\FixerFileProcessedEvent;
+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::';
+
+ /** @var string */
+ protected static $defaultName = 'worker';
+
+ /** @var string */
+ 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(FixerFileProcessedEvent::NAME, function (FixerFileProcessedEvent $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/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php b/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php
index bad1a6a6f9..1b594bed4d 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/ConfigurationResolver.php
+++ b/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;
@@ -75,10 +77,7 @@ final class ConfigurationResolver
*/
private $configFile;
- /**
- * @var string
- */
- private $cwd;
+ private string $cwd;
private ConfigInterface $defaultConfig;
@@ -98,7 +97,7 @@ final class ConfigurationResolver
private $isDryRun;
/**
- * @var null|FixerInterface[]
+ * @var null|list
*/
private $fixers;
@@ -109,6 +108,9 @@ final class ConfigurationResolver
private ToolInfoInterface $toolInfo;
+ /**
+ * @var array
+ */
private array $options = [
'allow-risky' => null,
'cache-file' => null,
@@ -119,6 +121,7 @@ final class ConfigurationResolver
'path' => [],
'path-mode' => self::PATH_MODE_OVERRIDE,
'rules' => null,
+ 'sequential' => null,
'show-progress' => null,
'stop-on-violation' => null,
'using-cache' => null,
@@ -146,18 +149,21 @@ final class ConfigurationResolver
private $directory;
/**
- * @var null|iterable
+ * @var null|iterable<\SplFileInfo>
*/
- private $finder;
+ private ?iterable $finder = null;
- private $format;
+ private ?string $format = null;
/**
* @var null|Linter
*/
private $linter;
- private $path;
+ /**
+ * @var null|list
+ */
+ private ?array $path = null;
/**
* @var null|string
@@ -179,6 +185,9 @@ final class ConfigurationResolver
*/
private $fixerFactory;
+ /**
+ * @param array $options
+ */
public function __construct(
ConfigInterface $config,
array $options,
@@ -269,6 +278,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) {
@@ -281,11 +299,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;
@@ -303,16 +317,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
{
@@ -325,19 +340,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)));
}
}
}
@@ -357,7 +368,7 @@ public function getLinter(): LinterInterface
/**
* Returns path.
*
- * @return string[]
+ * @return list
*/
public function getPath(): array
{
@@ -381,7 +392,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
));
@@ -400,26 +411,27 @@ static function (string $rawPath) use ($cwd, $filesystem): string {
/**
* @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;
}
}
@@ -440,7 +452,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)));
}
}
@@ -462,6 +474,8 @@ public function getRiskyAllowed(): bool
/**
* Returns rules.
+ *
+ * @return array|bool>
*/
public function getRules(): array
{
@@ -478,11 +492,14 @@ public function getUsingCache(): bool
}
}
- $this->usingCache = $this->usingCache && ($this->toolInfo->isInstalledAsPhar() || $this->toolInfo->isInstalledByComposer());
+ $this->usingCache = $this->usingCache && $this->isCachingAllowedForRuntime();
return $this->usingCache;
}
+ /**
+ * @return iterable<\SplFileInfo>
+ */
public function getFinder(): iterable
{
if (null === $this->finder) {
@@ -526,7 +543,7 @@ public function configFinderIsOverridden(): bool
/**
* Compute file candidates for config file.
*
- * @return string[]
+ * @return list
*/
private function computeConfigFiles(): array
{
@@ -534,7 +551,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];
@@ -550,7 +567,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 = [
@@ -613,13 +630,20 @@ private function isStdIn(): bool
return $this->isStdIn;
}
+ /**
+ * @template T
+ *
+ * @param iterable $iterable
+ *
+ * @return \Traversable
+ */
private function iterableToTraversable(iterable $iterable): \Traversable
{
return \is_array($iterable) ? new \ArrayIterator($iterable) : $iterable;
}
/**
- * Compute rules.
+ * @return array
*/
private function parseRules(): array
{
@@ -636,7 +660,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;
@@ -662,6 +686,8 @@ private function parseRules(): array
}
/**
+ * @param array $rules
+ *
* @throws InvalidConfigurationException
*/
private function validateRules(array $rules): void
@@ -675,7 +701,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;
@@ -683,20 +709,13 @@ private function validateRules(array $rules): void
$ruleSet = new RuleSet($ruleSet);
- /** @var string[] $configuredFixers */
$configuredFixers = array_keys($ruleSet->getRules());
$fixers = $this->createFixerFactory()->getFixers();
- /** @var string[] $availableFixers */
- $availableFixers = array_map(static function (FixerInterface $fixer): string {
- return $fixer->getName();
- }, $fixers);
+ $availableFixers = array_map(static fn (FixerInterface $fixer): string => $fixer->getName(), $fixers);
- $unknownFixers = array_diff(
- $configuredFixers,
- $availableFixers
- );
+ $unknownFixers = array_diff($configuredFixers, $availableFixers);
if (\count($unknownFixers) > 0) {
$renamedRules = [
@@ -758,16 +777,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.'"?)'
@@ -778,7 +797,7 @@ private function validateRules(array $rules): void
$message = substr($message, 0, -2).'.';
if ($hasOldRule) {
- $message .= "\nFor more info about updating see: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.0.0/UPGRADE-v3.md#renamed-ruless.";
+ $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);
@@ -789,8 +808,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}"));
}
@@ -799,6 +818,8 @@ private function validateRules(array $rules): void
/**
* Apply path on config instance.
+ *
+ * @return iterable<\SplFileInfo>
*/
private function resolveFinder(): iterable
{
@@ -815,21 +836,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) {
@@ -907,7 +926,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;
@@ -918,7 +937,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) {
@@ -929,7 +948,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
@@ -938,9 +957,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/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php
index 3e0efdaf74..2c54e1376b 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ErrorOutput.php
@@ -17,6 +17,7 @@
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;
@@ -39,11 +40,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 +52,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 +80,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'], $trace['function']) && \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 +99,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
@@ -117,21 +118,32 @@ public function listErrors(string $process, array $errors): void
}
}
+ /**
+ * @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(
+ $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']));
}
}
@@ -139,7 +151,6 @@ private function prepareOutput(string $string): string
{
return $this->isDecorated
? OutputFormatter::escape($string)
- : $string
- ;
+ : $string;
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php
new file mode 100644
index 0000000000..84a0ea6f8d
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/OutputContext.php
@@ -0,0 +1,52 @@
+
+ * Dariusz 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;
+
+/**
+ * @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/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutput.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php
similarity index 63%
rename from vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutput.php
rename to vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php
index 6ca9d2760f..afe8322b4c 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/ProcessOutput.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/DotsOutput.php
@@ -12,37 +12,35 @@
* with this source code in the file LICENSE.
*/
-namespace PhpCsFixer\Console\Output;
+namespace PhpCsFixer\Console\Output\Progress;
+use PhpCsFixer\Console\Output\OutputContext;
use PhpCsFixer\FixerFileProcessedEvent;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
- * Output writer to show the process of a FixCommand.
+ * Output writer to show the progress of a FixCommand using dots and meaningful letters.
*
* @internal
*/
-final class ProcessOutput implements ProcessOutputInterface
+final class DotsOutput implements ProgressOutputInterface
{
/**
* File statuses map.
+ *
+ * @var array
*/
private static array $eventStatusMap = [
- FixerFileProcessedEvent::STATUS_UNKNOWN => ['symbol' => '?', 'format' => '%s', 'description' => 'unknown'],
- FixerFileProcessedEvent::STATUS_INVALID => ['symbol' => 'I', 'format' => '%s', 'description' => 'invalid file syntax (file ignored)'],
- FixerFileProcessedEvent::STATUS_SKIPPED => ['symbol' => 'S', 'format' => '%s', 'description' => 'skipped (cached or empty file)'],
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;
+ /** @readonly */
+ private OutputContext $context;
private int $processedFiles = 0;
@@ -51,22 +49,14 @@ final class ProcessOutput implements ProcessOutputInterface
*/
private $symbolsPerLine;
- public function __construct(OutputInterface $output, EventDispatcherInterface $dispatcher, int $width, int $nbFiles)
+ public function __construct(OutputContext $context)
{
- $this->output = $output;
- $this->eventDispatcher = $dispatcher;
- $this->eventDispatcher->addListener(FixerFileProcessedEvent::NAME, [$this, 'onFixerFileProcessed']);
- $this->files = $nbFiles;
+ $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, $width - \strlen((string) $this->files) * 2 - 11);
- }
-
- public function __destruct()
- {
- $this->eventDispatcher->removeListener(FixerFileProcessedEvent::NAME, [$this, 'onFixerFileProcessed']);
+ $this->symbolsPerLine = max(1, $context->getTerminalWidth() - \strlen((string) $context->getFilesCount()) * 2 - 11);
}
/**
@@ -75,7 +65,7 @@ public function __destruct()
*/
public function __sleep(): array
{
- throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
+ throw new \BadMethodCallException('Cannot serialize '.self::class);
}
/**
@@ -86,30 +76,30 @@ public function __sleep(): array
*/
public function __wakeup(): void
{
- throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
+ throw new \BadMethodCallException('Cannot unserialize '.self::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->getOutput()->write($this->getOutput()->isDecorated() ? \sprintf($status['format'], $status['symbol']) : $status['symbol']);
++$this->processedFiles;
$symbolsOnCurrentLine = $this->processedFiles % $this->symbolsPerLine;
- $isLast = $this->processedFiles === $this->files;
+ $isLast = $this->processedFiles === $this->context->getFilesCount();
if (0 === $symbolsOnCurrentLine || $isLast) {
- $this->output->write(sprintf(
- '%s %'.\strlen((string) $this->files).'d / %d (%3d%%)',
+ $this->getOutput()->write(\sprintf(
+ '%s %'.\strlen((string) $this->context->getFilesCount()).'d / %d (%3d%%)',
$isLast && 0 !== $symbolsOnCurrentLine ? str_repeat(' ', $this->symbolsPerLine - $symbolsOnCurrentLine) : '',
$this->processedFiles,
- $this->files,
- round($this->processedFiles / $this->files * 100)
+ $this->context->getFilesCount(),
+ round($this->processedFiles / $this->context->getFilesCount() * 100)
));
if (!$isLast) {
- $this->output->writeln('');
+ $this->getOutput()->writeln('');
}
}
}
@@ -124,9 +114,14 @@ public function printLegend(): void
continue;
}
- $symbols[$symbol] = sprintf('%s-%s', $this->output->isDecorated() ? sprintf($status['format'], $symbol) : $symbol, $status['description']);
+ $symbols[$symbol] = \sprintf('%s-%s', $this->getOutput()->isDecorated() ? \sprintf($status['format'], $symbol) : $symbol, $status['description']);
}
- $this->output->write(sprintf("\nLegend: %s\n", implode(', ', $symbols)));
+ $this->getOutput()->write(\sprintf("\nLegend: %s\n", implode(', ', $symbols)));
+ }
+
+ private function getOutput(): OutputInterface
+ {
+ return $this->context->getOutput();
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.php
new file mode 100644
index 0000000000..3af7ee4435
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/NullOutput.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\FixerFileProcessedEvent;
+
+/**
+ * @internal
+ */
+final class NullOutput implements ProgressOutputInterface
+{
+ public function printLegend(): void {}
+
+ public function onFixerFileProcessed(FixerFileProcessedEvent $event): void {}
+}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.php
new file mode 100644
index 0000000000..369bed1d41
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/PercentageBarOutput.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\Console\Output\Progress;
+
+use PhpCsFixer\Console\Output\OutputContext;
+use PhpCsFixer\FixerFileProcessedEvent;
+use Symfony\Component\Console\Helper\ProgressBar;
+
+/**
+ * Output writer to show the progress of a FixCommand using progress bar (percentage).
+ *
+ * @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(FixerFileProcessedEvent $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/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.php
new file mode 100644
index 0000000000..71027d833a
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputFactory.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\Console\Output\Progress;
+
+use PhpCsFixer\Console\Output\OutputContext;
+
+/**
+ * @internal
+ */
+final class ProgressOutputFactory
+{
+ /**
+ * @var array>
+ */
+ private static array $outputTypeMap = [
+ ProgressOutputType::NONE => NullOutput::class,
+ ProgressOutputType::DOTS => DotsOutput::class,
+ ProgressOutputType::BAR => PercentageBarOutput::class,
+ ];
+
+ 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
+ )
+ );
+ }
+
+ return new self::$outputTypeMap[$outputType]($context);
+ }
+
+ private function isBuiltInType(string $outputType): bool
+ {
+ return \in_array($outputType, ProgressOutputType::all(), true);
+ }
+}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputInterface.php
new file mode 100644
index 0000000000..b5ab951730
--- /dev/null
+++ b/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\FixerFileProcessedEvent;
+
+/**
+ * @internal
+ */
+interface ProgressOutputInterface
+{
+ public function printLegend(): void;
+
+ public function onFixerFileProcessed(FixerFileProcessedEvent $event): void;
+}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Output/Progress/ProgressOutputType.php
new file mode 100644
index 0000000000..6f427a46d9
--- /dev/null
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php
index c283b23820..48daf7b2fa 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/CheckstyleReporter.php
@@ -14,6 +14,7 @@
namespace PhpCsFixer\Console\Report\FixReport;
+use PhpCsFixer\Console\Application;
use Symfony\Component\Console\Formatter\OutputFormatter;
/**
@@ -23,17 +24,11 @@
*/
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 +36,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/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php
index 974d66d119..23aad2e838 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/GitlabReporter.php
+++ b/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;
/**
@@ -27,6 +31,13 @@
*/
final class GitlabReporter implements ReporterInterface
{
+ private Parser $diffParser;
+
+ public function __construct()
+ {
+ $this->diffParser = new Parser();
+ }
+
public function getFormat(): string
{
return 'gitlab';
@@ -37,25 +48,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/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php
index 6bb05120c0..0dc01dba4d 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JsonReporter.php
@@ -14,6 +14,7 @@
namespace PhpCsFixer\Console\Report\FixReport;
+use PhpCsFixer\Console\Application;
use Symfony\Component\Console\Formatter\OutputFormatter;
/**
@@ -23,17 +24,11 @@
*/
final class JsonReporter implements ReporterInterface
{
- /**
- * {@inheritdoc}
- */
public function getFormat(): string
{
return 'json';
}
- /**
- * {@inheritdoc}
- */
public function generate(ReportSummary $reportSummary): string
{
$jsonFiles = [];
@@ -45,7 +40,7 @@ public function generate(ReportSummary $reportSummary): string
$jsonFile['appliedFixers'] = $fixResult['appliedFixers'];
}
- if (!empty($fixResult['diff'])) {
+ if ('' !== $fixResult['diff']) {
$jsonFile['diff'] = $fixResult['diff'];
}
@@ -53,14 +48,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/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php
index 1614f37ca9..ca2817fd87 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/JunitReporter.php
@@ -14,6 +14,7 @@
namespace PhpCsFixer\Console\Report\FixReport;
+use PhpCsFixer\Console\Application;
use PhpCsFixer\Preg;
use Symfony\Component\Console\Formatter\OutputFormatter;
@@ -24,17 +25,11 @@
*/
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 +39,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 +59,9 @@ public function generate(ReportSummary $reportSummary): string
if ($reportSummary->getTime() > 0) {
$testsuite->setAttribute(
'time',
- sprintf(
+ \sprintf(
'%.3f',
- $reportSummary->getTime() / 1000
+ $reportSummary->getTime() / 1_000
)
);
}
@@ -102,6 +104,9 @@ private function createFailedTestCases(\DOMDocument $dom, \DOMElement $testsuite
$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']);
@@ -127,7 +132,7 @@ private function createFailedTestCase(\DOMDocument $dom, string $file, array $fi
$failureContent = "Wrong code style\n";
}
- if (!empty($fixResult['diff'])) {
+ if ('' !== $fixResult['diff']) {
$failureContent .= "\nDiff:\n---------------\n\n".$fixResult['diff'];
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php
index 3c48a0628e..ccdfefb322 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReportSummary.php
@@ -21,8 +21,13 @@
*/
final class ReportSummary
{
+ /**
+ * @var array, diff: string}>
+ */
private array $changed;
+ private int $filesCount;
+
private int $time;
private int $memory;
@@ -34,11 +39,13 @@ final class ReportSummary
private bool $isDecoratedOutput;
/**
- * @param int $time duration in milliseconds
- * @param int $memory memory usage in bytes
+ * @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,
@@ -46,6 +53,7 @@ public function __construct(
bool $isDecoratedOutput
) {
$this->changed = $changed;
+ $this->filesCount = $filesCount;
$this->time = $time;
$this->memory = $memory;
$this->addAppliedFixers = $addAppliedFixers;
@@ -63,6 +71,9 @@ public function isDryRun(): bool
return $this->isDryRun;
}
+ /**
+ * @return array, diff: string}>
+ */
public function getChanged(): array
{
return $this->changed;
@@ -78,6 +89,11 @@ public function getTime(): int
return $this->time;
}
+ public function getFilesCount(): int
+ {
+ return $this->filesCount;
+ }
+
public function shouldAddAppliedFixers(): bool
{
return $this->addAppliedFixers;
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php
index 5ffcb5ad04..1b2d81229b 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/ReporterFactory.php
@@ -15,7 +15,6 @@
namespace PhpCsFixer\Console\Report\FixReport;
use Symfony\Component\Finder\Finder as SymfonyFinder;
-use Symfony\Component\Finder\SplFileInfo;
/**
* @author Boris Gorbylev
@@ -24,26 +23,23 @@
*/
final class ReporterFactory
{
- /**
- * @var ReporterInterface[]
- */
+ /** @var array */
private array $reporters = [];
public function registerBuiltInReporters(): self
{
- /** @var null|string[] $builtInReporters */
+ /** @var null|list $builtInReporters */
static $builtInReporters;
if (null === $builtInReporters) {
$builtInReporters = [];
- /** @var SplFileInfo $file */
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')
);
}
@@ -64,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;
@@ -73,7 +69,7 @@ public function registerReporter(ReporterInterface $reporter): self
}
/**
- * @return string[]
+ * @return list
*/
public function getFormats(): array
{
@@ -86,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/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php
index 19525bc931..79a548e9eb 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/TextReporter.php
@@ -23,71 +23,80 @@
*/
final class TextReporter implements ReporterInterface
{
- /**
- * {@inheritdoc}
- */
public function getFormat(): string
{
return 'txt';
}
- /**
- * {@inheritdoc}
- */
public function generate(ReportSummary $reportSummary): string
{
$output = '';
- $i = 0;
+ $identifiedFiles = 0;
foreach ($reportSummary->getChanged() as $file => $fixResult) {
- ++$i;
- $output .= sprintf('%4d) %s', $i, $file);
+ ++$identifiedFiles;
+ $output .= \sprintf('%4d) %s', $identifiedFiles, $file);
if ($reportSummary->shouldAddAppliedFixers()) {
- $output .= $this->getAppliedFixers($reportSummary->isDecoratedOutput(), $fixResult);
+ $output .= $this->getAppliedFixers(
+ $reportSummary->isDecoratedOutput(),
+ $fixResult['appliedFixers'],
+ );
}
- $output .= $this->getDiff($reportSummary->isDecoratedOutput(), $fixResult);
+ $output .= $this->getDiff($reportSummary->isDecoratedOutput(), $fixResult['diff']);
$output .= PHP_EOL;
}
- return $output.$this->getFooter($reportSummary->getTime(), $reportSummary->getMemory(), $reportSummary->isDryRun());
+ return $output.$this->getFooter(
+ $reportSummary->getTime(),
+ $identifiedFiles,
+ $reportSummary->getFilesCount(),
+ $reportSummary->getMemory(),
+ $reportSummary->isDryRun()
+ );
}
- private function getAppliedFixers(bool $isDecoratedOutput, array $fixResult): string
+ /**
+ * @param list $appliedFixers
+ */
+ private function getAppliedFixers(bool $isDecoratedOutput, array $appliedFixers): string
{
- return sprintf(
+ return \sprintf(
$isDecoratedOutput ? ' (%s)' : ' (%s)',
- implode(', ', $fixResult['appliedFixers'])
+ implode(', ', $appliedFixers)
);
}
- private function getDiff(bool $isDecoratedOutput, array $fixResult): string
+ private function getDiff(bool $isDecoratedOutput, string $diff): string
{
- if (empty($fixResult['diff'])) {
+ if ('' === $diff) {
return '';
}
- $diffFormatter = new DiffConsoleFormatter($isDecoratedOutput, sprintf(
+ $diffFormatter = new DiffConsoleFormatter($isDecoratedOutput, \sprintf(
' ---------- begin diff ----------%s%%s%s ----------- end diff -----------',
PHP_EOL,
PHP_EOL
));
- return PHP_EOL.$diffFormatter->format($fixResult['diff']).PHP_EOL;
+ return PHP_EOL.$diffFormatter->format($diff).PHP_EOL;
}
- private function getFooter(int $time, int $memory, bool $isDryRun): string
+ 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 all files in %.3f seconds, %.3f MB memory used'.PHP_EOL,
- $isDryRun ? 'Checked' : 'Fixed',
- $time / 1000,
- $memory / 1024 / 1024
+ 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/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php
index 16edd37900..78209ba928 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/FixReport/XmlReporter.php
@@ -14,6 +14,7 @@
namespace PhpCsFixer\Console\Report\FixReport;
+use PhpCsFixer\Console\Application;
use Symfony\Component\Console\Formatter\OutputFormatter;
/**
@@ -23,17 +24,11 @@
*/
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 +40,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);
@@ -56,11 +53,13 @@ public function generate(ReportSummary $reportSummary): string
$filesXML->appendChild($fileXML);
if ($reportSummary->shouldAddAppliedFixers()) {
- $fileXML->appendChild($this->createAppliedFixersElement($dom, $fixResult));
+ $fileXML->appendChild(
+ $this->createAppliedFixersElement($dom, $fixResult['appliedFixers']),
+ );
}
- if (!empty($fixResult['diff'])) {
- $fileXML->appendChild($this->createDiffElement($dom, $fixResult));
+ if ('' !== $fixResult['diff']) {
+ $fileXML->appendChild($this->createDiffElement($dom, $fixResult['diff']));
}
}
@@ -77,11 +76,14 @@ public function generate(ReportSummary $reportSummary): string
return $reportSummary->isDecoratedOutput() ? OutputFormatter::escape($dom->saveXML()) : $dom->saveXML();
}
- private function createAppliedFixersElement(\DOMDocument $dom, array $fixResult): \DOMElement
+ /**
+ * @param list $appliedFixers
+ */
+ private function createAppliedFixersElement(\DOMDocument $dom, array $appliedFixers): \DOMElement
{
$appliedFixersXML = $dom->createElement('applied_fixers');
- foreach ($fixResult['appliedFixers'] as $appliedFixer) {
+ foreach ($appliedFixers as $appliedFixer) {
$appliedFixerXML = $dom->createElement('applied_fixer');
$appliedFixerXML->setAttribute('name', $appliedFixer);
$appliedFixersXML->appendChild($appliedFixerXML);
@@ -90,17 +92,17 @@ private function createAppliedFixersElement(\DOMDocument $dom, array $fixResult)
return $appliedFixersXML;
}
- private function createDiffElement(\DOMDocument $dom, array $fixResult): \DOMElement
+ private function createDiffElement(\DOMDocument $dom, string $diff): \DOMElement
{
$diffXML = $dom->createElement('diff');
- $diffXML->appendChild($dom->createCDATASection($fixResult['diff']));
+ $diffXML->appendChild($dom->createCDATASection($diff));
return $diffXML;
}
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');
@@ -113,7 +115,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);
@@ -121,4 +123,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/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php
index 2046939717..ceebd89e33 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/JsonReporter.php
@@ -23,24 +23,16 @@
*/
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 +45,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/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php
index 6ca98d9a41..c7d66e7151 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReportSummary.php
@@ -24,12 +24,12 @@
final class ReportSummary
{
/**
- * @var RuleSetDescriptionInterface[]
+ * @var list
*/
private array $sets;
/**
- * @param RuleSetDescriptionInterface[] $sets
+ * @param list $sets
*/
public function __construct(array $sets)
{
@@ -37,7 +37,7 @@ public function __construct(array $sets)
}
/**
- * @return RuleSetDescriptionInterface[]
+ * @return list
*/
public function getSets(): array
{
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php
index abf211e954..ad963f6d46 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/ReporterFactory.php
@@ -15,7 +15,6 @@
namespace PhpCsFixer\Console\Report\ListSetsReport;
use Symfony\Component\Finder\Finder as SymfonyFinder;
-use Symfony\Component\Finder\SplFileInfo;
/**
* @author Boris Gorbylev
@@ -25,25 +24,24 @@
final class ReporterFactory
{
/**
- * @var ReporterInterface[]
+ * @var array
*/
private array $reporters = [];
public function registerBuiltInReporters(): self
{
- /** @var null|string[] $builtInReporters */
+ /** @var null|list $builtInReporters */
static $builtInReporters;
if (null === $builtInReporters) {
$builtInReporters = [];
- /** @var SplFileInfo $file */
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')
);
}
@@ -61,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;
@@ -70,7 +68,7 @@ public function registerReporter(ReporterInterface $reporter): self
}
/**
- * @return string[]
+ * @return list
*/
public function getFormats(): array
{
@@ -83,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/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php
index 0caddef57f..65c4156eab 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/Report/ListSetsReport/TextReporter.php
@@ -23,29 +23,21 @@
*/
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/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php
index 3da780fe4e..b32113049f 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClient.php
@@ -19,36 +19,44 @@
*/
final class GithubClient implements GithubClientInterface
{
- /**
- * {@inheritdoc}
- */
+ private string $url = 'https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/tags';
+
public function getTags(): array
{
- $url = 'https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/tags';
-
$result = @file_get_contents(
- $url,
+ $this->url,
false,
stream_context_create([
'http' => [
- 'header' => 'User-Agent: FriendsOfPHP/PHP-CS-Fixer',
+ 'header' => 'User-Agent: PHP-CS-Fixer/PHP-CS-Fixer',
],
])
);
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/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php
index 25e02a6cbb..27728327fc 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/GithubClientInterface.php
@@ -19,5 +19,8 @@
*/
interface GithubClientInterface
{
+ /**
+ * @return list
+ */
public function getTags(): array;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php
index 54ec34ddbe..fc28677cfe 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Console/SelfUpdate/NewVersionChecker.php
@@ -28,7 +28,7 @@ final class NewVersionChecker implements NewVersionCheckerInterface
private VersionParser $versionParser;
/**
- * @var null|string[]
+ * @var null|list
*/
private $availableVersions;
@@ -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/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php b/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php
index 85ac917934..7465c2a477 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Console/WarningsDetector.php
+++ b/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 = [];
@@ -42,7 +42,7 @@ public function detectOldMajor(): void
// $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/FriendsOfPHP/PHP-CS-Fixer/blob/v{$nextMajorVersion}.0.0/UPGRADE-v{$nextMajorVersion}.md .";
+ // $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
@@ -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/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php b/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php
index f52ed44a74..97e8f747f9 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Differ/DiffConsoleFormatter.php
@@ -40,10 +40,9 @@ public function format(string $diff, string $lineTemplate = '%s'): string
$template = $isDecorated
? $this->template
- : Preg::replace('/<[^<>]+>/', '', $this->template)
- ;
+ : Preg::replace('/<[^<>]+>/', '', $this->template);
- return sprintf(
+ return \sprintf(
$template,
implode(
PHP_EOL,
@@ -62,7 +61,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,
@@ -74,7 +73,7 @@ static function (array $matches): string {
}
}
- return sprintf($lineTemplate, $line);
+ return \sprintf($lineTemplate, $line);
},
Preg::split('#\R#u', $diff)
)
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php b/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php
index ee5d738fe4..a927ede40d 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Differ/FullDiffer.php
@@ -14,8 +14,8 @@
namespace PhpCsFixer\Differ;
-use PhpCsFixer\Diff\Differ;
-use PhpCsFixer\Diff\Output\StrictUnifiedDiffOutputBuilder;
+use SebastianBergmann\Diff\Differ;
+use SebastianBergmann\Diff\Output\StrictUnifiedDiffOutputBuilder;
/**
* @author Dariusz Rumiński
@@ -37,9 +37,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/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php b/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php
index 8ef968ee68..cf07f9e744 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Differ/NullDiffer.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php b/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php
index fa2233b313..36663aa19f 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Differ/UnifiedDiffer.php
@@ -14,15 +14,12 @@
namespace PhpCsFixer\Differ;
-use PhpCsFixer\Diff\Differ;
-use PhpCsFixer\Diff\Output\StrictUnifiedDiffOutputBuilder;
use PhpCsFixer\Preg;
+use SebastianBergmann\Diff\Differ;
+use SebastianBergmann\Diff\Output\StrictUnifiedDiffOutputBuilder;
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/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php
index aae73e3c45..d3f09830f2 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Annotation.php
@@ -29,7 +29,7 @@ final class Annotation
/**
* All the annotation tag names with types.
*
- * @var string[]
+ * @var list
*/
private static array $tags = [
'method',
@@ -46,9 +46,9 @@ final class Annotation
/**
* The lines that make up the annotation.
*
- * @var Line[]
+ * @var array
*/
- private $lines;
+ private array $lines;
/**
* The position of the first line of the annotation in the docblock.
@@ -81,7 +81,7 @@ final class Annotation
/**
* The cached types.
*
- * @var null|string[]
+ * @var null|list
*/
private $types;
@@ -91,16 +91,16 @@ final class Annotation
private $namespace;
/**
- * @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 +108,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,7 +123,7 @@ public function __toString(): string
/**
* Get all the annotation tag names with types.
*
- * @return string[]
+ * @return list
*/
public static function getTagsWithTypes(): array
{
@@ -163,20 +161,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 +193,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,7 +210,7 @@ public function getTypes(): array
/**
* Set the types associated with this annotation.
*
- * @param string[] $types
+ * @param list $types
*/
public function setTypes(array $types): void
{
@@ -216,13 +224,11 @@ 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());
+ $normalized = array_map(static fn (string $type): string => strtolower($type), $this->getTypes());
sort($normalized);
@@ -275,7 +281,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 +291,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/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php
index efdcff32da..b4ae53e222 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/DocBlock.php
@@ -28,29 +28,25 @@
final class DocBlock
{
/**
- * The array of lines.
- *
- * @var Line[]
+ * @var list
*/
private array $lines = [];
/**
- * The array of annotations.
- *
- * @var null|Annotation[]
+ * @var null|list
*/
- private $annotations;
+ private ?array $annotations = null;
- /**
- * @var null|NamespaceAnalysis
- */
- private $namespace;
+ private ?NamespaceAnalysis $namespace;
/**
- * @var NamespaceUseAnalysis[]
+ * @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) {
@@ -61,9 +57,6 @@ public function __construct(string $content, ?NamespaceAnalysis $namespace = nul
$this->namespaceUses = $namespaceUses;
}
- /**
- * Get the string representation of object.
- */
public function __toString(): string
{
return $this->getContent();
@@ -72,7 +65,7 @@ public function __toString(): string
/**
* Get this docblock's lines.
*
- * @return Line[]
+ * @return list
*/
public function getLines(): array
{
@@ -90,7 +83,7 @@ public function getLine(int $pos): ?Line
/**
* Get this docblock's annotations.
*
- * @return Annotation[]
+ * @return list
*/
public function getAnnotations(): array
{
@@ -159,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)) {
@@ -186,23 +177,20 @@ public function getAnnotation(int $pos): ?Annotation
/**
* Get specific types of annotations only.
*
- * If none exist, we're returning an empty array.
+ * @param list|string $types
*
- * @param string|string[] $types
- *
- * @return Annotation[]
+ * @return list
*/
public function getAnnotationsOfType($types): array
{
+ $typesToSearchFor = (array) $types;
+
$annotations = [];
- $types = (array) $types;
foreach ($this->getAnnotations() as $annotation) {
- $tag = $annotation->getTag()->getName();
- foreach ($types as $type) {
- if ($type === $tag) {
- $annotations[] = $annotation;
- }
+ $tagName = $annotation->getTag()->getName();
+ if (\in_array($tagName, $typesToSearchFor, true)) {
+ $annotations[] = $annotation;
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php
index 0db50e8284..9ef4a08740 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Line.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Tag.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Tag.php
index 988c19b713..6206718dc5 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Tag.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/Tag.php
@@ -20,15 +20,14 @@
* 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.
- *
- * @var string[]
*/
- private static array $tags = [
+ 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',
@@ -42,10 +41,8 @@ final class Tag
/**
* The cached tag name.
- *
- * @var null|string
*/
- private $name;
+ private ?string $name = null;
/**
* Create a new tag instance.
@@ -100,6 +97,6 @@ public function setName(string $name): void
*/
public function valid(): bool
{
- return \in_array($this->getName(), self::$tags, true);
+ return \in_array($this->getName(), self::PSR_STANDARD_TAGS, true);
}
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php
index 2f41451981..c5a3a89631 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TagComparator.php
@@ -19,13 +19,20 @@
* 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
*/
- private static array $groups = [
+ public const DEFAULT_GROUPS = [
['deprecated', 'link', 'see', 'since'],
['author', 'copyright', 'license'],
['category', 'package', 'subpackage'],
@@ -34,9 +41,13 @@ final class TagComparator
/**
* Should the given tags be kept together, or kept apart?
+ *
+ * @param list> $groups
*/
- public static function shouldBeTogether(Tag $first, Tag $second): bool
+ 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();
@@ -44,7 +55,7 @@ public static function shouldBeTogether(Tag $first, Tag $second): bool
return true;
}
- foreach (self::$groups as $group) {
+ foreach ($groups as $group) {
if (\in_array($firstName, $group, true) && \in_array($secondName, $group, true)) {
return true;
}
diff --git a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php
index 02e1ffba78..4836fbca75 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/DocBlock/TypeExpression.php
@@ -20,117 +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.]+
- | \'[^\']+?\' | "[^"]+?"
- | [@$]?(?: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)
+ )*+
+ ))
+ |)
+ )';
- /**
- * @var string
- */
- private $value;
+ private string $value;
private bool $isUnionType = false;
+ private string $typesGlue = '|';
+
/**
* @var list
*/
private array $innerTypeExpressions = [];
- private string $typesGlue = '|';
-
- /**
- * @var null|NamespaceAnalysis
- */
- private $namespace;
+ private ?NamespaceAnalysis $namespace;
/**
- * @var NamespaceUseAnalysis[]
+ * @var list
*/
- private $namespaceUses;
+ private array $namespaceUses;
/**
- * @param NamespaceUseAnalysis[] $namespaceUses
+ * @param list $namespaceUses
*/
public function __construct(string $value, ?NamespaceAnalysis $namespace, array $namespaceUses)
{
@@ -147,55 +242,84 @@ public function toString(): string
}
/**
- * @return string[]
+ * @return list
*/
public function getTypes(): array
{
if ($this->isUnionType) {
return array_map(
- static function (array $type) { return $type['expression']->toString(); },
- $this->innerTypeExpressions
+ static fn (array $type) => $type['expression']->toString(),
+ $this->innerTypeExpressions,
);
}
return [$this->value];
}
+ public function isUnionType(): bool
+ {
+ return $this->isUnionType;
+ }
+
+ public function getTypesGlue(): string
+ {
+ return $this->typesGlue;
+ }
+
/**
- * @param callable(self $a, self $b): int $compareCallback
+ * @param \Closure(self): void $callback
*/
- public function sortTypes(callable $compareCallback): void
+ public function walkTypes(\Closure $callback): void
{
- foreach (array_reverse($this->innerTypeExpressions) as [
- 'start_index' => $startIndex,
+ $innerValueOrig = $this->value;
+
+ $startIndexOffset = 0;
+
+ foreach ($this->innerTypeExpressions as [
+ 'start_index' => $startIndexOrig,
'expression' => $inner,
]) {
- $initialValueLength = \strlen($inner->toString());
+ $innerLengthOrig = \strlen($inner->toString());
- $inner->sortTypes($compareCallback);
+ $inner->walkTypes($callback);
$this->value = substr_replace(
$this->value,
$inner->toString(),
- $startIndex,
- $initialValueLength
+ $startIndexOrig + $startIndexOffset,
+ $innerLengthOrig
);
+
+ $startIndexOffset += \strlen($inner->toString()) - $innerLengthOrig;
}
- if ($this->isUnionType) {
- $this->innerTypeExpressions = Utils::stableSort(
- $this->innerTypeExpressions,
- static function (array $type): self { return $type['expression']; },
- $compareCallback
- );
+ $callback($this);
+
+ if ($this->value !== $innerValueOrig) {
+ $this->isUnionType = false;
+ $this->typesGlue = '|';
+ $this->innerTypeExpressions = [];
- $this->value = implode($this->getTypesGlue(), $this->getTypes());
+ $this->parse();
}
}
- public function getTypesGlue(): string
+ /**
+ * @param \Closure(self, self): (-1|0|1) $compareCallback
+ */
+ public function sortTypes(\Closure $compareCallback): void
{
- return $this->typesGlue;
+ $this->walkTypes(static function (self $type) use ($compareCallback): void {
+ if ($type->isUnionType) {
+ $type->innerTypeExpressions = Utils::stableSort(
+ $type->innerTypeExpressions,
+ static fn (array $type): self => $type['expression'],
+ $compareCallback,
+ );
+
+ $type->value = implode($type->getTypesGlue(), $type->getTypes());
+ }
+ });
}
public function getCommonType(): ?string
@@ -209,14 +333,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('/^(.+?)', $type, $matches)) {
+ } elseif (Preg::match('/^(.+?)\h*[<{(]/', $type, $matches)) {
$type = $matches[1];
}
+ if (isset($aliases[$type])) {
+ $type = $aliases[$type];
+ }
+
if (null === $mainType || $type === $mainType) {
$mainType = $type;
@@ -236,7 +366,7 @@ public function getCommonType(): ?string
public function allowsNull(): bool
{
foreach ($this->getTypes() as $type) {
- if (\in_array($type, ['null', 'mixed'], true)) {
+ if (\in_array($type, ['null', 'mixed'], true) || str_starts_with($type, '?')) {
return true;
}
}
@@ -246,135 +376,243 @@ public function allowsNull(): bool
private function parse(): void
{
- $value = $this->value;
+ $index = 0;
+ while (true) {
+ Preg::match(
+ '{\G'.self::REGEX_TYPE.'(?:\h*(?[|&])\h*|$)}',
+ $this->value,
+ $matches,
+ PREG_OFFSET_CAPTURE,
+ $index
+ );
- Preg::match(
- '{^'.self::REGEX_TYPES.'$}x',
- $value,
- $matches
- );
+ if ([] === $matches) {
+ throw new \Exception('Unable to parse phpdoc type '.var_export($this->value, true));
+ }
+
+ if (!$this->isUnionType) {
+ if (($matches['glue'][0] ?? '') === '') {
+ break;
+ }
+
+ $this->isUnionType = true;
+ $this->typesGlue = $matches['glue'][0];
+ }
- if ([] === $matches) {
- return;
+ $this->innerTypeExpressions[] = [
+ 'start_index' => $index,
+ 'expression' => $this->inner($matches['type'][0]),
+ ];
+
+ $consumedValueLength = \strlen($matches[0][0]);
+ $index += $consumedValueLength;
+
+ if (\strlen($this->value) <= $index) {
+ \assert(\strlen($this->value) === $index);
+
+ return;
+ }
}
- $this->typesGlue = $matches['glue'] ?? $this->typesGlue;
+ $nullableLength = \strlen($matches['nullable'][0]);
+ $index = $nullableLength;
- $index = '' !== $matches['nullable'] ? 1 : 0;
+ if ('' !== ($matches['generic'][0] ?? '') && $matches['generic'][1] === $nullableLength) {
+ $this->parseCommaSeparatedInnerTypes(
+ $index + \strlen($matches['generic_start'][0]),
+ $matches['generic_types'][0]
+ );
+ } elseif ('' !== ($matches['callable'][0] ?? '') && $matches['callable'][1] === $nullableLength) {
+ $this->parseCallableTemplateInnerTypes(
+ $index + \strlen($matches['callable_name'][0])
+ + \strlen($matches['callable_template_start'][0]),
+ $matches['callable_template_inners'][0]
+ );
- if ($matches['type'] !== $matches['types']) {
- $this->isUnionType = true;
+ $this->parseCallableArgumentTypes(
+ $index + \strlen($matches['callable_name'][0])
+ + \strlen($matches['callable_template'][0])
+ + \strlen($matches['callable_start'][0]),
+ $matches['callable_arguments'][0]
+ );
- while (true) {
- $innerType = $matches['type'];
+ 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] ?? '') && $matches['array_shape'][1] === $nullableLength) {
+ $this->parseArrayShapeInnerTypes(
+ $index + \strlen($matches['array_shape_start'][0]),
+ $matches['array_shape_inners'][0]
+ );
+ } elseif ('' !== ($matches['parenthesized'][0] ?? '') && $matches['parenthesized'][1] === $nullableLength) {
+ $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]),
+ ];
+ }
- $newValue = Preg::replace(
- '/^'.preg_quote($innerType, '/').'(\h*[|&]\h*)?/',
- '',
- $value
- );
+ $index += \strlen($matches['conditional_cond_left'][0]) + \strlen($matches['conditional_cond_middle'][0]);
$this->innerTypeExpressions[] = [
'start_index' => $index,
- 'expression' => $this->inner($innerType),
+ 'expression' => $this->inner($matches['conditional_cond_right_types'][0]),
];
- if ('' === $newValue) {
- return;
- }
+ $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($value) - \strlen($newValue);
- $value = $newValue;
+ $index += \strlen($matches['conditional_true_types'][0]) + \strlen($matches['conditional_false_start'][0]);
- Preg::match(
- '{^'.self::REGEX_TYPES.'$}x',
- $value,
- $matches
- );
+ $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]),
+ ];
}
}
+ }
- if ('' !== ($matches['generic'] ?? '')) {
- $this->parseCommaSeparatedInnerTypes(
- $index + \strlen($matches['generic_start']),
- $matches['generic_types']
+ 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
);
- return;
+ $this->innerTypeExpressions[] = [
+ 'start_index' => $startIndex + $index,
+ 'expression' => $this->inner($matches['types']),
+ ];
+
+ $index += \strlen($matches[0]);
}
+ }
- if ('' !== ($matches['callable'] ?? '')) {
- $this->parseCommaSeparatedInnerTypes(
- $index + \strlen($matches['callable_start']),
- $matches['callable_arguments'] ?? ''
+ 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
);
- $return = $matches['callable_return'] ?? null;
- if (null !== $return) {
+ if ('' !== $matches['callable_template_inner_b'][0]) {
$this->innerTypeExpressions[] = [
- 'start_index' => \strlen($this->value) - \strlen($matches['callable_return']),
- 'expression' => $this->inner($matches['callable_return']),
+ 'start_index' => $startIndex + $index + $matches['callable_template_inner_b_types'][1]
+ - \strlen($addedPrefix),
+ 'expression' => $this->inner($matches['callable_template_inner_b_types'][0]),
];
}
- return;
- }
+ 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]),
+ ];
+ }
- if ('' !== ($matches['object_like_array'] ?? '')) {
- $this->parseObjectLikeArrayKeys(
- $index + \strlen($matches['object_like_array_start']),
- $matches['object_like_array_keys']
- );
+ $index += $consumedValueLength + $consumedCommaLength;
}
}
- private function parseCommaSeparatedInnerTypes(int $startIndex, string $value): void
+ private function parseCallableArgumentTypes(int $startIndex, string $value): void
{
- while ('' !== $value) {
+ $index = 0;
+ while (\strlen($value) !== $index) {
Preg::match(
- '{^'.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,
- 'expression' => $this->inner($matches['types']),
+ 'start_index' => $startIndex + $index,
+ 'expression' => $this->inner($matches['callable_argument_type'][0]),
];
- $newValue = Preg::replace(
- '/^'.preg_quote($matches['types'], '/').'(\h*\,\h*)?/',
- '',
- $value
- );
-
- $startIndex += \strlen($value) - \strlen($newValue);
- $value = $newValue;
+ $index += $consumedValueLength + $consumedCommaLength;
}
}
- private function parseObjectLikeArrayKeys(int $startIndex, string $value): void
+ private function parseArrayShapeInnerTypes(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.'|(?<_array_shape_inner>(?&array_shape_inner))(?:\h*,\h*|$))}',
$value,
- $matches
+ $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 + \strlen($matches['_start']),
- 'expression' => $this->inner($matches['types']),
+ 'start_index' => $startIndex + $index + $matches['array_shape_inner_value'][1]
+ - \strlen($addedPrefix),
+ 'expression' => $this->inner($matches['array_shape_inner_value'][0]),
];
- $newValue = Preg::replace(
- '/^.+?:\h*'.preg_quote($matches['types'], '/').'(\h*\,\h*)?/',
- '',
- $value
- );
-
- $startIndex += \strlen($value) - \strlen($newValue);
- $value = $newValue;
+ $index += $consumedValueLength + $consumedCommaLength;
}
}
@@ -414,6 +652,7 @@ private function normalize(string $type): string
'array',
'bool',
'callable',
+ 'false',
'float',
'int',
'iterable',
@@ -423,16 +662,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('/^(.+?)', $type, $matches)) {
+ if (Preg::match('/^(.+?)', $type, $matches)) {
return $matches[1];
}
@@ -454,7 +694,7 @@ private function normalize(string $type): string
}
/**
- * @return array
+ * @return array
*/
private function getAliases(): array
{
@@ -464,6 +704,7 @@ private function getAliases(): array
'double' => 'float',
'false' => 'bool',
'integer' => 'int',
+ 'list' => 'array',
'real' => 'float',
'true' => 'bool',
];
diff --git a/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php
new file mode 100644
index 0000000000..2335efb04f
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/DocLexer.php
@@ -0,0 +1,173 @@
+
+ * Dariusz 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
+ {
+ if (!isset($this->regex)) {
+ $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/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php
index 4e5a4a5db8..56cb83e47c 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Token.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php
index 3f7a47789f..b73d14a4d7 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php
@@ -14,7 +14,6 @@
namespace PhpCsFixer\Doctrine\Annotation;
-use Doctrine\Common\Annotations\DocLexer;
use PhpCsFixer\Preg;
use PhpCsFixer\Tokenizer\Token as PhpToken;
@@ -28,7 +27,7 @@
final class Tokens extends \SplFixedArray
{
/**
- * @param string[] $ignoredTags
+ * @param list $ignoredTags
*
* @throws \InvalidArgumentException
*/
@@ -59,27 +58,27 @@ public static function createFromDocComment(PhpToken $input, array $ignoredTags
$nbScannedTokensToUse = 0;
$nbScopes = 0;
while (null !== $token = $lexer->peek()) {
- if (0 === $index && DocLexer::T_AT !== $token['type']) {
+ if (0 === $index && !$token->isType(DocLexer::T_AT)) {
break;
}
if (1 === $index) {
- if (DocLexer::T_IDENTIFIER !== $token['type'] || \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 && !\in_array($token['type'], [DocLexer::T_NONE, DocLexer::T_OPEN_PARENTHESIS], true)) {
+ if ($index >= 2 && 0 === $nbScopes && !$token->isType([DocLexer::T_NONE, DocLexer::T_OPEN_PARENTHESIS])) {
break;
}
$scannedTokens[] = $token;
- if (DocLexer::T_OPEN_PARENTHESIS === $token['type']) {
+ if ($token->isType(DocLexer::T_OPEN_PARENTHESIS)) {
++$nbScopes;
- } elseif (DocLexer::T_CLOSE_PARENTHESIS === $token['type']) {
+ } elseif ($token->isType(DocLexer::T_CLOSE_PARENTHESIS)) {
if (0 === --$nbScopes) {
$nbScannedTokensToUse = \count($scannedTokens);
@@ -101,12 +100,16 @@ public static function createFromDocComment(PhpToken $input, array $ignoredTags
}
$lastTokenEndIndex = 0;
- foreach (\array_slice($scannedTokens, 0, $nbScannedTokensToUse) as $token) {
- if (DocLexer::T_STRING === $token['type']) {
- $token['value'] = '"'.str_replace('"', '""', $token['value']).'"';
- }
-
- $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,
@@ -115,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;
}
@@ -135,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
{
@@ -242,9 +245,8 @@ public function insertAt(int $index, Token $token): void
public function offsetSet($index, $token): void
{
- // @phpstan-ignore-next-line as we type checking here
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) {
@@ -254,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/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php b/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php
index 6b9f436839..3769c4fdea 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Documentation/DocumentationLocator.php
@@ -23,10 +23,7 @@
*/
final class DocumentationLocator
{
- /**
- * @var string
- */
- private $path;
+ private string $path;
public function __construct()
{
@@ -46,10 +43,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';
}
@@ -78,8 +73,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/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php b/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php
index 4de98f4bba..19ef36a937 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Documentation/FixerDocumentGenerator.php
+++ b/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;
@@ -64,11 +65,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,38 +110,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();
@@ -137,39 +153,35 @@ 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);
if (null === $allowed) {
$allowedKind = 'Allowed types';
- $allowed = array_map(static function ($value): string {
- return '``'.$value.'``';
- }, $option->getAllowedTypes());
+ $allowed = array_map(
+ static fn (string $value): string => '``'.Utils::convertArrayTypeToList($value).'``',
+ $option->getAllowedTypes(),
+ );
} else {
$allowedKind = 'Allowed values';
-
- foreach ($allowed as &$value) {
- if ($value instanceof AllowedValueSubset) {
- $value = 'a subset of ``'.HelpCommand::toString($value->getAllowedValues()).'``';
- } else {
- $value = '``'.HelpCommand::toString($value).'``';
- }
- }
+ $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.";
@@ -185,12 +197,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}";
@@ -198,9 +210,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())
);
}
}
@@ -209,53 +221,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
{
@@ -265,20 +306,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) {
@@ -296,23 +335,26 @@ public function generateFixersDocumentationIndex(array $fixers): string
$attributes[] = 'deprecated';
}
+ if ($fixer instanceof ExperimentalFixerInterface) {
+ $attributes[] = 'experimental';
+ }
+
if ($fixer->isRisky()) {
$attributes[] = 'risky';
}
$attributes = 0 === \count($attributes)
? ''
- : ' *('.implode(', ', $attributes).')*'
- ;
+ : ' *('.implode(', ', $attributes).')*';
$summary = str_replace('`', '``', $fixer->getDefinition()->getSummary());
$documentation .= <<getName()} <{$path}>`_{$attributes}
+ - `{$fixer->getName()} <{$path}>`_{$attributes}
- {$summary}
-RST;
+ {$summary}
+ RST;
}
return "{$documentation}\n";
@@ -333,12 +375,12 @@ private function generateSampleDiff(FixerInterface $fixer, CodeSampleInterface $
$error = <<getCode();
@@ -346,8 +388,7 @@ private function generateSampleDiff(FixerInterface $fixer, CodeSampleInterface $
$tokens = Tokens::fromCode($old);
$file = $sample instanceof FileSpecificCodeSampleInterface
? $sample->getSplFileInfo()
- : new StdinFileInfo()
- ;
+ : new StdinFileInfo();
if ($fixer instanceof ConfigurableFixerInterface) {
$fixer->configure($sample->getConfiguration() ?? []);
@@ -364,9 +405,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 function ($value): string {
- return '``'.$value.'``';
- }, $option->getAllowedTypes());
- } else {
- $allowedKind = 'Allowed values';
-
- foreach ($allowed as &$value) {
- if ($value instanceof AllowedValueSubset) {
- $value = 'a subset of ``'.HelpCommand::toString($value->getAllowedValues()).'``';
- } else {
- $value = '``'.HelpCommand::toString($value).'``';
- }
- }
- }
-
- $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/vendor/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php b/vendor/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php
index b7b5c51c58..129bc5d0ee 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Documentation/RstUtils.php
+++ b/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,38 +47,93 @@ 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;
}
- $doc .= "\n\n";
+ 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 (\count($rules) < 1) {
- $doc .= 'This is an empty set.';
+ if ([] === $rules) {
+ $doc .= "\n\nThis is an empty set.";
} else {
- $doc .= "Rules\n-----\n";
-
- 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}>`_";
+ $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 (!\is_bool($config)) {
- $doc .= "\n config:\n ``".HelpCommand::toString($config).'``';
- }
+ if ([] !== $enabledRules) {
+ $doc .= "\n\nRules\n-----\n";
+ $listRules($enabledRules);
+ }
+
+ if ([] !== $disabledRules) {
+ $doc .= "\n\nDisabled rules\n--------------\n";
+ $listRules($disabledRules);
}
}
@@ -85,18 +141,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/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php b/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php
index b2ad97dfc4..d0c5ac7ea1 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Error/Error.php
@@ -21,7 +21,7 @@
*
* @internal
*/
-final class Error
+final class Error implements \JsonSerializable
{
/**
* Error which has occurred in linting phase, before applying any fixers.
@@ -38,22 +38,24 @@ final class Error
*/
public const TYPE_LINT = 3;
+ /** @var self::TYPE_* */
private int $type;
private string $filePath;
+ private ?\Throwable $source;
+
/**
- * @var null|\Throwable
+ * @var list
*/
- private $source;
-
private array $appliedFixers;
+ private ?string $diff;
+
/**
- * @var null|string
+ * @param self::TYPE_* $type
+ * @param list $appliedFixers
*/
- private $diff;
-
public function __construct(int $type, string $filePath, ?\Throwable $source = null, array $appliedFixers = [], ?string $diff = null)
{
$this->type = $type;
@@ -78,6 +80,9 @@ public function getType(): int
return $this->type;
}
+ /**
+ * @return list
+ */
public function getAppliedFixers(): array
{
return $this->appliedFixers;
@@ -87,4 +92,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/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php b/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php
index 01006673a8..e6333db80f 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Error/ErrorsManager.php
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php b/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php
new file mode 100644
index 0000000000..5180b08e51
--- /dev/null
+++ b/vendor/friendsofphp/php-cs-fixer/src/Error/SourceExceptionFactory.php
@@ -0,0 +1,60 @@
+
+ * Dariusz 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;
+
+/**
+ * @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/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php b/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandler.php
new file mode 100644
index 0000000000..003398e49c
--- /dev/null
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php b/vendor/friendsofphp/php-cs-fixer/src/ExecutorWithoutErrorHandlerException.php
new file mode 100644
index 0000000000..750352a265
--- /dev/null
+++ b/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/vendor/friendsofphp/php-cs-fixer/src/FileReader.php b/vendor/friendsofphp/php-cs-fixer/src/FileReader.php
index d71f5f76e0..ec36e3a6b2 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/FileReader.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/FileReader.php
@@ -61,10 +61,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/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php b/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php
index f3fd7f8ee9..148a4c5e14 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/FileRemoval.php
@@ -26,6 +26,8 @@ final class FileRemoval
{
/**
* List of observed files to be removed.
+ *
+ * @var array
*/
private array $files = [];
@@ -45,7 +47,7 @@ public function __destruct()
*/
public function __sleep(): array
{
- throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
+ throw new \BadMethodCallException('Cannot serialize '.self::class);
}
/**
@@ -56,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/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php b/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php
index 42a92a7ef9..b6a8660c7a 100644
--- a/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php
+++ b/vendor/friendsofphp/php-cs-fixer/src/Fixer/AbstractPhpUnitFixer.php
@@ -15,7 +15,15 @@
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;
/**
@@ -23,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]);
}
@@ -44,15 +49,229 @@ abstract protected function applyPhpUnitClassFix(Tokens $tokens, int $startIndex
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);
- } while ($tokens[$index]->isGivenKind([T_PUBLIC, T_PROTECTED, T_PRIVATE, T_FINAL, T_ABSTRACT, T_COMMENT]));
+
+ 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