Skip to content

refactor: let the WpCli module run without Laravel's application - #465

Open
ogorzalka wants to merge 1 commit into
release/v13.36.0from
refactor/wp-cli-decoupling
Open

ogorzalka wants to merge 1 commit into
release/v13.36.0from
refactor/wp-cli-decoupling

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

First step of extracting pollora/wp-cli (roadmap, medium term: "close to WordPress already; depends mostly on discovery"). Nothing moves yet.

What changes

  • WpCliDiscovery builds command instances through the discovery's instance pool, keeping one per class, instead of a fallback calling resolve(). In a Pollora application the pool uses Laravel's container, as before; elsewhere pollora/discovery's reflection autowiring.
  • tests/Unit/WpCli/PackageBoundaryTest.php: the module may only use the attributes, discovery, PSR logging and WP-CLI. WpCliServiceProvider (console detection) and pollora:make:wp-cli stay in the framework. The test fails on the previous code (also uses 'resolve').

No behaviour change: in production the engine always gave the discovery its pool.

Checks

1881 tests, PHPStan 0, Rector clean. Independent of #464.

WpCliDiscovery builds commands through the discovery's instance pool instead of resolve(). An architecture test keeps the module, provider and generator aside, to the attributes, discovery, PSR logging and WP-CLI.
@ogorzalka
ogorzalka force-pushed the refactor/wp-cli-decoupling branch from b3472df to dfa210d Compare October 12, 2026 16:06
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