Skip to content

cleverage/process-bundle#143 - ZipTask and UnzipTask: compatibility with process-bundle v6.0 - #24

Draft
njoubert-cleverage wants to merge 1 commit into
mainfrom
process-bundle-143
Draft

njoubert-cleverage wants to merge 1 commit into
mainfrom
process-bundle-143

Conversation

@njoubert-cleverage

@njoubert-cleverage njoubert-cleverage commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Description

Refs cleverage/process-bundle#143, linked to cleverage/process-bundle#253 (merged into dev-v6, milestone v6.0): this PR must be released before process-bundle v6.0.

In process-bundle v6.0, AbstractConfigurableTask::getOptions() returns an array instead of ?array. ZipTask and UnzipTask override it with a ?array return type, which is then a fatal error (Declaration of ...ZipTask::getOptions(...): ?array must be compatible with ...AbstractConfigurableTask::getOptions(...): array). This PR:

  • declares an array return type on both overrides (covariant with the v5 ?array, so it works with v5 and v6), and removes the @phpstan-ignore return.type;
  • always resolves the options in getOptions() (from the contextualized options, merged with the input when it is an array), instead of returning null when the input is not an array (execute() already rejects a non-array input before);
  • overrides initialize() as a no-op: the options depend on the input, so they cannot be validated on initialization (the input is always null there). This keeps the current behaviour: on initialization, getOptions() used to return null without resolving anything;
  • keeps the 2.5 deprecation of max_files / max_size given by the input of archive_unzip; the zip bomb checks and the atomic write of ZipTask are untouched;
  • reads the contextualized options with an (array) cast instead of ?? [] (not nullable in v6);
  • allows cleverage/process-bundle ^5.4|^6.0.

Rebased on main (after v2.6). Checked against process-bundle v5.10 (installed) and v6 (dev-v6 sources, with cleverage/process-bundle#253): PHPStan (no ignore), PHPUnit (also with coverage, no risky test), PHP-CS-Fixer and Rector pass with both (Rector would remove the (array) casts once only v6 is supported). With v6, the current main fails with the fatal error above. The CI only installs released versions of process-bundle, so ^6.0 is not tested there until v6.0 is tagged.

Requirements

  • Documentation updates
    • Reference (already says that the options are validated on execution, not on initialization)
    • Cookbooks
    • Changelog
  • Unit tests (no behaviour change, covered by the existing tests)

Breaking changes

None for users of the tasks. Classes extending ZipTask / UnzipTask (@final since 2.3) and overriding getOptions() with a ?array return type must declare array.

🤖 Generated with Claude Code

…ons() returns an array and options are not read on initialization, for compatibility with cleverage/process-bundle v6.0

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage marked this pull request as ready for review December 1, 2026 14:29
@njoubert-cleverage
njoubert-cleverage requested a review from a team as a code owner December 1, 2026 14:29
@njoubert-cleverage
njoubert-cleverage marked this pull request as draft December 1, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant