Skip to content

Autowire blueprint services during controller rendering - #44

Merged
josbeir merged 1 commit into
mainfrom
feature/automatic-blueprint-di
Oct 18, 2026
Merged

josbeir merged 1 commit into
mainfrom
feature/automatic-blueprint-di

Conversation

@josbeir

@josbeir josbeir commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Blueprints and discovered field types with constructor dependencies now use the application container during normal controller rendering. Applications keep their ordinary FormCompose helper registration; controller actions no longer need to pass a blueprint factory through template variables.

The plugin obtains the application factory during bootstrap and registers the view bridge through its events() hook. Explicit application, view, and helper factories retain precedence, while standalone views keep the dependency-free fallback. Regression tests use CakePHP's standard View; the custom test AppView is removed. The service guide now shows constructor injection alongside the rendering call, with manual wiring confined to standalone-view and custom-factory details.

Validation:

  • composer validate --strict and composer check: 803 tests, 3,152 assertions; analysis, lint, Rector, and formatting pass.
  • composer test-coverage with Xdebug: 100% line coverage (2,511/2,511); all 17 changed executable source lines covered.
  • npm ci, npm run docs:build, and npm run test:browser: 53 browser tests pass. Documentation API examples, imports, local links, and populated code tabs also checked.

@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c18f128) to head (60ea66a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #44   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity      1082      1088    +6     
===========================================
  Files            120       120           
  Lines           2919      2935   +16     
===========================================
+ Hits            2919      2935   +16     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@josbeir
josbeir merged commit 1a42e99 into main Oct 18, 2026
6 checks passed
@josbeir
josbeir deleted the feature/automatic-blueprint-di branch October 18, 2026 15:12
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.

2 participants