Repository: PHP-CS-Fixer/PHP-CS-Fixer (php)

Issue:
Buffer size exceeded exceptions when running in parallel
### Problem description

Having just added php-cs-fixer to a project, and integrated it into our Jenkins CI pipeline, I get the following errors:

```
+ ./vendor/bin/php-cs-fixer check --no-interaction --show-progress=none --diff --using-cache=no -vvv
PHP CS Fixer 3.58.1 7th Gear by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.1.28
Running analysis on 16 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config default from "/var/lib/jenkins/workspace/REDACTED/.php-cs-fixer.php".

In Runner.php line 325:

  [PhpCsFixer\Runner\Parallel\ParallelisationException]
  Buffer size exceeded


Exception trace:
  at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php:325
 PhpCsFixer\Runner\Runner::PhpCsFixer\Runner\{closure}() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Runner/Parallel/Process.php:176
 PhpCsFixer\Runner\Parallel\Process->PhpCsFixer\Runner\Parallel\{closure}() at /var/lib/jenkins/workspace/REDACTED/vendor/evenement/evenement/src/EventEmitterTrait.php:143
 Evenement\EventEmitter->emit() at /var/lib/jenkins/workspace/REDACTED/vendor/clue/ndjson-react/src/Decoder.php:163
 Clue\React\NDJson\Decoder->handleError() at /var/lib/jenkins/workspace/REDACTED/vendor/clue/ndjson-react/src/Decoder.php:143
 Clue\React\NDJson\Decoder->handleData() at /var/lib/jenkins/workspace/REDACTED/vendor/evenement/evenement/src/EventEmitterTrait.php:143
 Evenement\EventEmitter->emit() at /var/lib/jenkins/workspace/REDACTED/vendor/react/stream/src/Util.php:71
 React\Stream\Util::React\Stream\{closure}() at /var/lib/jenkins/workspace/REDACTED/vendor/evenement/evenement/src/EventEmitterTrait.php:143
 Evenement\EventEmitter->emit() at /var/lib/jenkins/workspace/REDACTED/vendor/react/stream/src/DuplexResourceStream.php:196
 React\Stream\DuplexResourceStream->handleData() at /var/lib/jenkins/workspace/REDACTED/vendor/react/event-loop/src/StreamSelectLoop.php:246
 React\EventLoop\StreamSelectLoop->waitForStreamActivity() at /var/lib/jenkins/workspace/REDACTED/vendor/react/event-loop/src/StreamSelectLoop.php:213
 React\EventLoop\StreamSelectLoop->run() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php:349
 PhpCsFixer\Runner\Runner->fixParallel() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php:157
 PhpCsFixer\Runner\Runner->fix() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php:338
 PhpCsFixer\Console\Command\FixCommand->execute() at /var/lib/jenkins/workspace/REDACTED/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/lib/jenkins/workspace/REDACTED/vendor/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php:176
 PhpCsFixer\Console\Application->doRunCommand() at /var/lib/jenkins/workspace/REDACTED/vendor/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php:98
 PhpCsFixer\Console\Application->doRun() at /var/lib/jenkins/workspace/REDACTED/vendor/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/php-cs-fixer:102
 include() at /var/lib/jenkins/workspace/REDACTED/vendor/bin/php-cs-fixer:119

In Decoder.php line 143:

  [OverflowException]
  Buffer size exceeded


Exception trace:
  at /var/lib/jenkins/workspace/REDACTED/vendor/clue/ndjson-react/src/Decoder.php:143
 Clue\React\NDJson\Decoder->handleData() at /var/lib/jenkins/workspace/REDACTED/vendor/evenement/evenement/src/EventEmitterTrait.php:143
 Evenement\EventEmitter->emit() at /var/lib/jenkins/workspace/REDACTED/vendor/react/stream/src/Util.php:71
 React\Stream\Util::React\Stream\{closure}() at /var/lib/jenkins/workspace/REDACTED/vendor/evenement/evenement/src/EventEmitterTrait.php:143
 Evenement\EventEmitter->emit() at /var/lib/jenkins/workspace/REDACTED/vendor/react/stream/src/DuplexResourceStream.php:196
 React\Stream\DuplexResourceStream->handleData() at /var/lib/jenkins/workspace/REDACTED/vendor/react/event-loop/src/StreamSelectLoop.php:246
 React\EventLoop\StreamSelectLoop->waitForStreamActivity() at /var/lib/jenkins/workspace/REDACTED/vendor/react/event-loop/src/StreamSelectLoop.php:213
 React\EventLoop\StreamSelectLoop->run() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php:349
 PhpCsFixer\Runner\Runner->fixParallel() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Runner/Runner.php:157
 PhpCsFixer\Runner\Runner->fix() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Console/Command/FixCommand.php:338
 PhpCsFixer\Console\Command\FixCommand->execute() at /var/lib/jenkins/workspace/REDACTED/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/lib/jenkins/workspace/REDACTED/vendor/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php:176
 PhpCsFixer\Console\Application->doRunCommand() at /var/lib/jenkins/workspace/REDACTED/vendor/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php:98
 PhpCsFixer\Console\Application->doRun() at /var/lib/jenkins/workspace/REDACTED/vendor/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/lib/jenkins/workspace/REDACTED/vendor/friendsofphp/php-cs-fixer/php-cs-fixer:102
 include() at /var/lib/jenkins/workspace/REDACTED/vendor/bin/php-cs-fixer:119

check [--path-mode PATH-MODE] [--allow-risky ALLOW-RISKY] [--config CONFIG] [--rules RULES] [--using-cache USING-CACHE] [--cache-file CACHE-FILE] [--diff] [--format FORMAT] [--stop-on-violation] [--show-progress SHOW-PROGRESS] [--sequential] [--] [<path>...]
```

There are a *lot* of files that need fixing, as we've only added the tool to the project and haven't yet run it against all the files to fix them.  So I'm not sure if the above is representative of the fact that there are too many things to report ... or if it's something else going on.

Adding `--sequential` to the command run in CI solves the problem (i.e. I get a big diff of all the fixes that need to be applied).


### Minimal reproducer

Hard to paste a reproducer as the code base is private and large. Our config file is:

```php
<?php

$finder = (new PhpCsFixer\Finder())
    ->in(__DIR__);

return (new PhpCsFixer\Config())
    ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
    ->setRules([
        '@PER-CS' => true,
        '@PHP82Migration' => true,
        'indentation_type' => true
    ])
    ->setIndent("\t")
    ->setLineEnding("\n")
    ->setFinder($finder);
```

I'm trusting the docs in that I don't need to explicitly exclude the `vendor` directory.

### Fixer version

3.58.1

### PHP version

8.1.28

### How do you run Fixer?

Composer package

### Contribution Checks

- [X] I have verified if this problem was already reported
- [X] I am familiar with ["Feature or bug?"](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/feature-or-bug.rst)

Pull request:
fix: Bump React's JSON decoder buffer size
Fixes #8066 (hopefully)

Patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 525640009..0cf7b3cc0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -36,6 +36,12 @@ jobs:
       - name: Checkout repository
         uses: actions/checkout@v4
 
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v3
+
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v3
+
       - name: Log in to the Container registry
         uses: docker/login-action@v3
         with:
@@ -64,6 +70,7 @@ jobs:
         uses: docker/build-push-action@v5
         with:
           context: .
+          platforms: linux/amd64,linux/arm64
           file: Dockerfile
           target: dist
           build-args: |
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90990e653..0ab3f816f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,22 @@ CHANGELOG for PHP CS Fixer
 
 This file contains changelogs for stable releases only.
 
+Changelog for v3.59.0
+---------------------
+
+* feat(Docker): Multi-arch build (support for `arm64`) (#8079)
+* feat: `@PhpCsFixer` ruleset - normalise implicit backslashes in single quoted strings (#7965)
+* feat: `SimpleToComplexStringVariableFixer` - support variable being an array (#8064)
+* fix: Look up for PHPDoc's variable name by only chars allowed in the variables (#8062)
+* fix: Update `PhpUnitTestCaseStaticMethodCallsFixer::STATIC_METHODS` (#8073)
+* fix: `native_constant_invocation` - array constants with native constant names (#8008)
+* chore: update PHPStan (#8060)
+* CI: Update PHPStan to 1.11.4 (#8074)
+* docs: don't expose list as config type for dicts (#8081)
+* docs: Make wording in `final_class` docs less dismissive (#8065)
+* docs: Update 1-bug_report.yml (#8067)
+* DX: Remove version from Docker Compose files (#8061)
+
 Changelog for v3.58.1
 ---------------------
 
diff --git a/doc/rules/alias/random_api_migration.rst b/doc/rules/alias/random_api_migration.rst
index c653e5f31..ff3f332bb 100644
--- a/doc/rules/alias/random_api_migration.rst
+++ b/doc/rules/alias/random_api_migration.rst
@@ -22,7 +22,7 @@ Configuration
 
 Mapping between replaced functions with the new ones.
 
-Allowed types: ``array``
+Allowed types: ``array<string, string>``
 
 Default value: ``['getrandmax' => 'mt_getrandmax', 'rand' => 'mt_rand', 'srand' => 'mt_srand']``
 
diff --git a/doc/rules/class_notation/class_attributes_separation.rst b/doc/rules/class_notation/class_attributes_separation.rst
index 123721434..c08d0e312 100644
--- a/doc/rules/class_notation/class_attributes_separation.rst
+++ b/doc/rules/class_notation/class_attributes_separation.rst
@@ -14,7 +14,7 @@ Configuration
 Dictionary of ``const|method|property|trait_import|case`` =>
 ``none|one|only_if_meta`` values.
 
-Allowed types: ``list<string>``
+Allowed types: ``array<string, string>``
 
 Default value: ``['const' => 'one', 'method' => 'one', 'property' => 'one', 'trait_import' => 'none', 'case' => 'none']``
 
diff --git a/doc/rules/operator/binary_operator_spaces.rst b/doc/rules/operator/binary_operator_spaces.rst
index f099668f3..c9d9ba185 100644
--- a/doc/rules/operator/binary_operator_spaces.rst
+++ b/doc/rules/operator/binary_operator_spaces.rst
@@ -26,7 +26,7 @@ the default strategy. Supported are: ``=``, ``*``, ``/``, ``%``, ``<``, ``>``,
 ``or``, ``xor``, ``-=``, ``%=``, ``*=``, ``|=``, ``+=``, ``<<``, ``<<=``,
 ``>>``, ``>>=``, ``^=``, ``**``, ``**=``, ``<=>``, ``??`` and ``??=``.
 
-Allowed types: ``array``
+Allowed types: ``array<string, ?string>``
 
 Default value: ``[]``
 
diff --git a/doc/rules/phpdoc/general_phpdoc_tag_rename.rst b/doc/rules/phpdoc/general_phpdoc_tag_rename.rst
index 6ec245b4c..97155d2e8 100644
--- a/doc/rules/phpdoc/general_phpdoc_tag_rename.rst
+++ b/doc/rules/phpdoc/general_phpdoc_tag_rename.rst
@@ -39,7 +39,7 @@ Default value: ``true``
 
 A map of tags to replace.
 
-Allowed types: ``list<string>``
+Allowed types: ``array<string, string>``
 
 Default value: ``[]``
 
diff --git a/doc/rules/phpdoc/phpdoc_align.rst b/doc/rules/phpdoc/phpdoc_align.rst
index f60e99bea..a5d673e73 100644
--- a/doc/rules/phpdoc/phpdoc_align.rst
+++ b/doc/rules/phpdoc/phpdoc_align.rst
@@ -27,7 +27,7 @@ spacingForB]``. If you want to define default spacing to more than 1 space use
 ``_default`` key in config array, e.g.: ``['tagA' => spacingForA, 'tagB' =>
 spacingForB, '_default' => spacingForAllOthers]``.
 
-Allowed types: ``int`` and ``list<int>``
+Allowed types: ``int`` and ``array<string, int>``
 
 Default value: ``1``
 
diff --git a/doc/rules/phpdoc/phpdoc_no_alias_tag.rst b/doc/rules/phpdoc/phpdoc_no_alias_tag.rst
index 28e39e269..a9aef370c 100644
--- a/doc/rules/phpdoc/phpdoc_no_alias_tag.rst
+++ b/doc/rules/phpdoc/phpdoc_no_alias_tag.rst
@@ -12,7 +12,7 @@ Configuration
 
 Mapping between replaced annotations with new ones.
 
-Allowed types: ``list<string>``
+Allowed types: ``array<string, string>``
 
 Default value: ``['property-read' => 'property', 'property-write' => 'property', 'type' => 'var', 'link' => 'see']``
 
diff --git a/doc/rules/phpdoc/phpdoc_return_self_reference.rst b/doc/rules/phpdoc/phpdoc_return_self_reference.rst
index 806eff1b3..ad253c7ad 100644
--- a/doc/rules/phpdoc/phpdoc_return_self_reference.rst
+++ b/doc/rules/phpdoc/phpdoc_return_self_reference.rst
@@ -13,7 +13,7 @@ Configuration
 
 Mapping between replaced return types with new ones.
 
-Allowed types: ``list<string>``
+Allowed types: ``array<string, string>``
 
 Default value: ``['this' => '$this', '@this' => '$this', '$self' => 'self', '@self' => 'self', '$static' => 'static', '@static' => 'static']``
 
diff --git a/doc/rules/phpdoc/phpdoc_tag_type.rst b/doc/rules/phpdoc/phpdoc_tag_type.rst
index eb6e98d8b..2e5517b83 100644
--- a/doc/rules/phpdoc/phpdoc_tag_type.rst
+++ b/doc/rules/phpdoc/phpdoc_tag_type.rst
@@ -12,7 +12,7 @@ Configuration
 
 The list of tags to fix.
 
-Allowed types: ``list<string>``
+Allowed types: ``array<string, 'annotation'|'inline'>``
 
 Default value: ``['api' => 'annotation', 'author' => 'annotation', 'copyright' => 'annotation', 'deprecated' => 'annotation', 'example' => 'annotation', 'global' => 'annotation', 'inheritDoc' => 'annotation', 'internal' => 'annotation', 'license' => 'annotation', 'method' => 'annotation', 'package' => 'annotation', 'param' => 'annotation', 'property' => 'annotation', 'return' => 'annotation', 'see' => 'annotation', 'since' => 'annotation', 'throws' => 'annotation', 'todo' => 'annotation', 'uses' => 'annotation', 'var' => 'annotation', 'version' => 'annotation']``
 
diff --git a/src/AbstractDoctrineAnnotationFixer.php b/src/AbstractDoctrineAnnotationFixer.php
index 327fa2388..45067d5f7 100644
--- a/src/AbstractDoctrineAnnotationFixer.php
+++ b/src/AbstractDoctrineAnnotationFixer.php
@@ -71,15 +71,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
         return new FixerConfigurationResolver([
             (new FixerOptionBuilder('ignored_tags', 'List of tags that must not be treated as Doctrine Annotations.'))
                 ->setAllowedTypes(['string[]'])
-                ->setAllowedValues([static function (array $values): bool {
-                    foreach ($values as $value) {
-                        if (!\is_string($value)) {
-                            return false;
-                        }
-                    }
-
-                    return true;
-                }])
                 ->setDefault([
                     // PHPDocumentor 1
                     'abstract',
diff --git a/src/Console/Application.php b/src/Console/Application.php
index 5077cbad3..e6514d42f 100644
--- a/src/Console/Application.php
+++ b/src/Console/Application.php
@@ -44,7 +44,7 @@
 final class Application extends BaseApplication
 {
     public const NAME = 'PHP CS Fixer';
-    public const VERSION = '3.58.2-DEV';
+    public const VERSION = '3.59.1-DEV';
     public const VERSION_CODENAME = '7th Gear';
 
     private ToolInfo $toolInfo;
diff --git a/src/Fixer/Alias/RandomApiMigrationFixer.php b/src/Fixer/Alias/RandomApiMigrationFixer.php
index 6d8c441fd..f3f2e82dc 100644
--- a/src/Fixer/Alias/RandomApiMigrationFixer.php
+++ b/src/Fixer/Alias/RandomApiMigrationFixer.php
@@ -119,7 +119,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
     {
         return new FixerConfigurationResolver([
             (new FixerOptionBuilder('replacements', 'Mapping between replaced functions with the new ones.'))
-                ->setAllowedTypes(['array'])
+                ->setAllowedTypes(['array<string, string>'])
                 ->setAllowedValues([static function (array $value): bool {
                     foreach ($value as $functionName => $replacement) {
                         if (!\array_key_exists($functionName, self::$argumentCounts)) {
@@ -128,14 +128,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
                                 $functionName
                             ));
                         }
-
-                        if (!\is_string($replacement)) {
-                            throw new InvalidOptionsException(sprintf(
-                                'Replacement for function "%s" must be a string, "%s" given.',
-                                $functionName,
-                                get_debug_type($replacement)
-                            ));
-                        }
                     }
 
                     return true;
diff --git a/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php b/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php
index 75de07d44..852f90da2 100644
--- a/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php
+++ b/src/Fixer/ClassNotation/ClassAttributesSeparationFixer.php
@@ -199,7 +199,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
     {
         return new FixerConfigurationResolver([
             (new FixerOptionBuilder('elements', 'Dictionary of `const|method|property|trait_import|case` => `none|one|only_if_meta` values.'))
-                ->setAllowedTypes(['string[]'])
+                ->setAllowedTypes(['array<string, string>'])
                 ->setAllowedValues([static function (array $option): bool {
                     foreach ($option as $type => $spacing) {
                         $supportedTypes = ['const', 'method', 'property', 'trait_import', 'case'];
diff --git a/src/Fixer/ClassNotation/FinalInternalClassFixer.php b/src/Fixer/ClassNotation/FinalInternalClassFixer.php
index 991b6164e..a80a660af 100644
--- a/src/Fixer/ClassNotation/FinalInternalClassFixer.php
+++ b/src/Fixer/ClassNotation/FinalInternalClassFixer.php
@@ -131,7 +131,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
     {
         $annotationsAsserts = [static function (array $values): bool {
             foreach ($values as $value) {
-                if (!\is_string($value) || '' === $value) {
+                if ('' === $value) {
                     return false;
                 }
             }
diff --git a/src/Fixer/ClassNotation/OrderedClassElementsFixer.php b/src/Fixer/ClassNotation/OrderedClassElementsFixer.php
index 449be871a..2a836a993 100644
--- a/src/Fixer/ClassNotation/OrderedClassElementsFixer.php
+++ b/src/Fixer/ClassNotation/OrderedClassElementsFixer.php
@@ -294,7 +294,7 @@ static function (array $values) use ($builtIns): bool {
                                 return true;
                             }
 
-                            if (\is_string($value) && 'method:' === substr($value, 0, 7)) {
+                            if ('method:' === substr($value, 0, 7)) {
                                 return true;
                             }
                         }
diff --git a/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php b/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php
index 9c900a539..3b092d52d 100644
--- a/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php
+++ b/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php
@@ -188,7 +188,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
     {
         $constantChecker = static function (array $value): bool {
             foreach ($value as $constantName) {
-                if (!\is_string($constantName) || '' === trim($constantName) || trim($constantName) !== $constantName) {
+                if (trim($constantName) !== $constantName) {
                     throw new InvalidOptionsException(sprintf(
                         'Each element must be a non-empty, trimmed string, got "%s" instead.',
                         get_debug_type($constantName)
diff --git a/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php b/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php
index a4e714069..3d592c332 100644
--- a/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php
+++ b/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php
@@ -205,7 +205,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
                 ->setAllowedTypes(['string[]'])
                 ->setAllowedValues([static function (array $value): bool {
                     foreach ($value as $functionName) {
-                        if (!\is_string($functionName) || '' === trim($functionName) || trim($functionName) !== $functionName) {
+                        if ('' === trim($functionName) || trim($functionName) !== $functionName) {
                             throw new InvalidOptionsException(sprintf(
                                 'Each element must be a non-empty, trimmed string, got "%s" instead.',
                                 get_debug_type($functionName)
@@ -221,7 +221,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
                 ->setAllowedTypes(['string[]'])
                 ->setAllowedValues([static function (array $value): bool {
                     foreach ($value as $functionName) {
-                        if (!\is_string($functionName) || '' === trim($functionName) || trim($functionName) !== $functionName) {
+                        if ('' === trim($functionName) || trim($functionName) !== $functionName) {
                             throw new InvalidOptionsException(sprintf(
                                 'Each element must be a non-empty, trimmed string, got "%s" instead.',
                                 get_debug_type($functionName)
diff --git a/src/Fixer/Operator/BinaryOperatorSpacesFixer.php b/src/Fixer/Operator/BinaryOperatorSpacesFixer.php
index 3e7f59b89..6d7db9998 100644
--- a/src/Fixer/Operator/BinaryOperatorSpacesFixer.php
+++ b/src/Fixer/Operator/BinaryOperatorSpacesFixer.php
@@ -358,7 +358,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
                 ->setAllowedValues(self::$allowedValues)
                 ->getOption(),
             (new FixerOptionBuilder('operators', 'Dictionary of `binary operator` => `fix strategy` values that differ from the default strategy. Supported are: '.Utils::naturalLanguageJoinWithBackticks(self::SUPPORTED_OPERATORS).'.'))
-                ->setAllowedTypes(['array'])
+                ->setAllowedTypes(['array<string, ?string>'])
                 ->setAllowedValues([static function (array $option): bool {
                     foreach ($option as $operator => $value) {
                         if (!\in_array($operator, self::SUPPORTED_OPERATORS, true)) {
diff --git a/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php b/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php
index efe9da1c1..3cf0e8000 100644
--- a/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php
+++ b/src/Fixer/Phpdoc/GeneralPhpdocTagRenameFixer.php
@@ -91,7 +91,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
                 ->setDefault(true)
                 ->getOption(),
             (new FixerOptionBuilder('replacements', 'A map of tags to replace.'))
-                ->setAllowedTypes(['string[]'])
+                ->setAllowedTypes(['array<string, string>'])
                 ->setNormalizer(static function (Options $options, array $value): array {
                     $normalizedValue = [];
 
@@ -100,13 +100,6 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
                             throw new InvalidOptionsException('Tag to replace must be a string.');
                         }
 
-                        if (!\is_string($to)) {
-                            throw new InvalidOptionsException(sprintf(
-                                'Tag to replace to from "%s" must be a string.',
-                                $from
-                            ));
-                        }
-
                         if (!Preg::match('#^\S+$#', $to) || str_contains($to, '*/')) {
                             throw new InvalidOptionsException(sprintf(
                                 'Tag "%s" cannot be replaced by invalid tag "%s".',
diff --git a/src/Fixer/Phpdoc/PhpdocAlignFixer.php b/src/Fixer/Phpdoc/PhpdocAlignFixer.php
index 0c30e6da2..59e715f93 100644
--- a/src/Fixer/Phpdoc/PhpdocAlignFixer.php
+++ b/src/Fixer/Phpdoc/PhpdocAlignFixer.php
@@ -245,7 +245,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
             'spacing',
             'Spacing between tag, hint, comment, signature, etc. You can set same spacing for all tags using a positive integer or different spacings for different tags using an associative array of positive integers `[\'tagA\' => spacingForA, \'tagB\' => spacingForB]`. If you want to define default spacing to more than 1 space use `_default` key in config array, e.g.: `[\'tagA\' => spacingForA, \'tagB\' => spacingForB, \'_default\' => spacingForAllOthers]`.'
         );
-        $spacing->setAllowedTypes(['int', 'int[]'])
+        $spacing->setAllowedTypes(['int', 'array<string, int>'])
             ->setAllowedValues([$allowPositiveIntegers])
             ->setDefault(self::DEFAULT_SPACING)
         ;
diff --git a/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php b/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php
index 48699f555..4bc96401f 100644
--- a/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php
+++ b/src/Fixer/Phpdoc/PhpdocNoAliasTagFixer.php
@@ -108,7 +108,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
     {
         return new FixerConfigurationResolver([
             (new FixerOptionBuilder('replacements', 'Mapping between replaced annotations with new ones.'))
-                ->setAllowedTypes(['string[]'])
+                ->setAllowedTypes(['array<string, string>'])
                 ->setDefault([
                     'property-read' => 'property',
                     'property-write' => 'property',
diff --git a/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php b/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php
index 3c204954d..5183ce1bf 100644
--- a/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php
+++ b/src/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixer.php
@@ -135,7 +135,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
 
         return new FixerConfigurationResolver([
             (new FixerOptionBuilder('replacements', 'Mapping between replaced return types with new ones.'))
-                ->setAllowedTypes(['string[]'])
+                ->setAllowedTypes(['array<string, string>'])
                 ->setNormalizer(static function (Options $options, array $value) use ($default): array {
                     $normalizedValue = [];
 
diff --git a/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php b/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php
index 54b6e2aed..ee36917e9 100644
--- a/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php
+++ b/src/Fixer/Phpdoc/PhpdocTagTypeFixer.php
@@ -135,7 +135,7 @@ protected function createConfigurationDefinition(): FixerConfigurationResolverIn
     {
         return new FixerConfigurationResolver([
             (new FixerOptionBuilder('tags', 'The list of tags to fix.'))
-                ->setAllowedTypes(['string[]'])
+                ->setAllowedTypes(["array<string, 'annotation'|'inline'>"])
                 ->setAllowedValues([static function (array $value): bool {
                     foreach ($value as $type) {
                         if (!\in_array($type, ['annotation', 'inline'], true)) {
diff --git a/src/FixerConfiguration/FixerConfigurationResolver.php b/src/FixerConfiguration/FixerConfigurationResolver.php
index ea073f25b..249a07be8 100644
--- a/src/FixerConfiguration/FixerConfigurationResolver.php
+++ b/src/FixerConfiguration/FixerConfigurationResolver.php
@@ -14,6 +14,7 @@
 
 namespace PhpCsFixer\FixerConfiguration;
 
+use PhpCsFixer\Preg;
 use PhpCsFixer\Utils;
 use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
 use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -96,7 +97,28 @@ public function resolve(array $configuration): array
 
             $allowedTypes = $option->getAllowedTypes();
             if (null !== $allowedTypes) {
-                $resolver->setAllowedTypes($name, $allowedTypes);
+                // Symfony OptionsResolver doesn't support `array<foo, bar>` natively, let's simplify the type
+                $allowedTypesNormalised = array_map(
+                    static function (string $type): string {
+                        $matches = [];
+                        if (true === Preg::match('/array<\w+,\s*(\??[\w\'|]+)>/', $type, $matches)) {
+                            if ('?' === $matches[1][0]) {
+                                return 'array';
+                            }
+
+                            if ("'" === $matches[1][0]) {
+                                return 'string[]';
+                            }
+
+                            return $matches[1].'[]';
+                        }
+
+                        return $type;
+                    },
+                    $allowedTypes,
+                );
+
+                $resolver->setAllowedTypes($name, $allowedTypesNormalised);
             }
 
             $normalizer = $option->getNormalizer();
diff --git a/src/Runner/Runner.php b/src/Runner/Runner.php
index f0c7e5fda..feb6a9620 100644
--- a/src/Runner/Runner.php
+++ b/src/Runner/Runner.php
@@ -57,6 +57,13 @@
  */
 final class Runner
 {
+    /**
+     * Buffer size used in the NDJSON decoder for communication between main process and workers.
+     *
+     * @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8068
+     */
+    private const PARALLEL_BUFFER_SIZE = 16 * (1_024 * 1_024 /* 1MB */);
+
     private DifferInterface $differ;
 
     private ?DirectoryInterface $directory;
@@ -203,7 +210,13 @@ private function fixParallel(): array
         // [REACT] Handle worker's handshake (init connection)
         $server->on('connection', static function (ConnectionInterface $connection) use ($processPool, $getFileChunk): void {
             $jsonInvalidUtf8Ignore = \defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0;
-            $decoder = new Decoder($connection, true, 512, $jsonInvalidUtf8Ignore);
+            $decoder = new Decoder(
+                $connection,
+                true,
+                512,
+                $jsonInvalidUtf8Ignore,
+                self::PARALLEL_BUFFER_SIZE
+            );
             $encoder = new Encoder($connection, $jsonInvalidUtf8Ignore);
 
             // [REACT] Bind connection when worker's process requests "hello" action (enables 2-way communication)


Test patch:
diff --git a/tests/Console/Command/DescribeCommandTest.php b/tests/Console/Command/DescribeCommandTest.php
index 67a74b345..50709d5df 100644
--- a/tests/Console/Command/DescribeCommandTest.php
+++ b/tests/Console/Command/DescribeCommandTest.php
@@ -525,7 +525,7 @@ public function getConfigurationDefinition(): FixerConfigurationResolver
 
                 return new FixerConfigurationResolver([
                     (new AliasedFixerOptionBuilder(new FixerOptionBuilder('functions', 'List of `function` names to fix.'), 'funcs'))
-                        ->setAllowedTypes(['array'])
+                        ->setAllowedTypes(['string[]'])
                         ->setAllowedValues([new AllowedValueSubset($functionNames)])
                         ->setDefault($functionNames)
                         ->getOption(),
diff --git a/tests/Fixer/Alias/RandomApiMigrationFixerTest.php b/tests/Fixer/Alias/RandomApiMigrationFixerTest.php
index d6c4ebd49..fd40cc240 100644
--- a/tests/Fixer/Alias/RandomApiMigrationFixerTest.php
+++ b/tests/Fixer/Alias/RandomApiMigrationFixerTest.php
@@ -48,7 +48,7 @@ public static function provideInvalidConfigurationCases(): iterable
         ];
 
         yield 'wrong replacement' => [
-            '[random_api_migration] Invalid configuration: Replacement for function "rand" must be a string, "null" given.',
+            '[random_api_migration] Invalid configuration: The option "replacements" with value array is expected to be of type "string[]", but one of the elements is of type "null".',
             ['replacements' => ['rand' => null]],
         ];
     }