Skip to content

Fix form construction for D11.#35

Merged
nchiasson-dgi merged 4 commits into
mainfrom
fix/d11-forms
Jun 10, 2026
Merged

Fix form construction for D11.#35
nchiasson-dgi merged 4 commits into
mainfrom
fix/d11-forms

Conversation

@adam-vessey

@adam-vessey adam-vessey commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Improved internal dependency injection patterns in form components for enhanced code maintainability.

@adam-vessey adam-vessey added the patch Backwards compatible bug fixes. label Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e1756121-359e-4d3d-83f5-bc1792103f4b

📥 Commits

Reviewing files that changed from the base of the PR and between c9eda1d and 581428e.

📒 Files selected for processing (2)
  • src/Form/CheckForm.php
  • src/Form/SettingsForm.php

📝 Walkthrough

Walkthrough

Two form classes refactor from constructor dependency injection to Drupal's container-based factory pattern with fluent setters. CheckForm wires the fixity service; SettingsForm wires entity type manager and state. Unused constructor imports are removed from both files.

Changes

Dependency Injection Refactoring

Layer / File(s) Summary
CheckForm DI refactoring
src/Form/CheckForm.php
Constructor-based fixity service injection replaced with container-driven create() factory and setFixity() fluent setter. Unused constructor dependency imports removed.
SettingsForm DI refactoring
src/Form/SettingsForm.php
Constructor-based dependency injection for ConfigFactoryInterface, EntityTypeManagerInterface, and StateInterface replaced with container-driven create() factory and fluent setters setEntityTypeManager() and setState(). Unused ConfigFactoryInterface import removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Two forms take the container's hand,
Dancing away from constructor's demand,
Fluent setters whisper their grace,
Factory methods take their place.
Cleaner imports, patterns refined,
Dependency joy, aligned by design! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix form construction for D11' is vague and generic, using non-descriptive terms that don't clearly convey the specific nature of the changes. Consider a more specific title that describes the actual refactoring, such as 'Refactor form dependency injection to use fluent setters' or 'Convert form constructors to use container-based injection'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/d11-forms

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.2.1)

Composer install failed: dependency resolution error. Check composer.json and composer.lock for version constraints.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@adam-vessey adam-vessey marked this pull request as ready for review June 10, 2026 14:24
@nchiasson-dgi nchiasson-dgi merged commit 51f4810 into main Jun 10, 2026
2 checks passed
@nchiasson-dgi nchiasson-dgi deleted the fix/d11-forms branch June 10, 2026 14:37
@github-actions

Copy link
Copy Markdown

Tag generated by PR: v1.4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Backwards compatible bug fixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants