Skip to content

[Code Quality] WorkermanCompilerPass sorts strategies but iterates tasks/processes inconsistently #371

@s2x

Description

@s2x

Location

src/DependencyInjection/WorkermanCompilerPass.php:28

Problem

The compiler pass calls uasort on $responseConverterStrategies (mutating it), then iterates $tasks and $processes via array_keys() without the same sort step. The inconsistency makes it unclear whether ordering matters for tasks/processes too.

What to change

  • Decide whether tasks/processes need deterministic ordering. If yes, apply the same sort consistently. If no, document why the strategies need it and the others do not.
  • Standardise the iteration style (e.g. always via array_keys or always via direct foreach on the sorted array).

Acceptance criteria

  • The ordering and iteration approach is consistent across the three tag sets (strategies, tasks, processes), or the difference is documented in the code.
  • Existing tests pass (vendor/bin/phpunit).
  • No behavioural change observable in service registration order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-qualityCode quality improvementsminorMinor priority - code quality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions