PHP 8.2+ modernization, DI mailer injection, and UI refinements.#334
PHP 8.2+ modernization, DI mailer injection, and UI refinements.#334terabytesoftw merged 9 commits intoyiisoft:masterfrom
8.2+ modernization, DI mailer injection, and UI refinements.#334Conversation
terabytesoftw
commented
Mar 10, 2026
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ✔️ |
| Breaks BC? | ❌ |
| Tests pass? | ❌ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #334 +/- ##
============================================
Coverage 100.00% 100.00%
- Complexity 43 44 +1
============================================
Files 10 13 +3
Lines 311 479 +168
============================================
+ Hits 311 479 +168 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Yii2 basic app for PHP 8.2+, refactors layout rendering into partials, and introduces DI-based mailer usage (wired through the Yii container and injected into SiteController) alongside UI refinements for the public pages.
Changes:
- Add
declare(strict_types=1);and introduce typed properties/return types across several app classes. - Refactor layout into
_head,_header, and_footerpartials; update navigation/logout rendering and refresh several public views/styles. - Switch contact email sending to use DI (
MailerInterface) with test bootstrap support to align DI container mailer with Codeception’s mail capture.
Reviewed changes
Copilot reviewed 27 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| widgets/Alert.php | Adds strict types, property typing, and refactors Bootstrap Alert usage. |
| web/index.php | Enables strict types for the web entrypoint. |
| web/index-test.php | Enables strict types for the test entrypoint. |
| web/css/site.css | Updates layout styling to flex-based container and adds centered-page rules. |
| views/site/index.php | Removes h-100 dependency and reformats helper calls for readability. |
| views/site/error.php | Adds strict types and redesigns error page layout (status code + call-to-action). |
| views/site/contact.php | Adds a “success” screen and refactors form field option structure. |
| views/site/about.php | Updates about page presentation and adds a homepage CTA. |
| views/layouts/main.php | Moves head/header/footer responsibilities into partials. |
| views/layouts/_head.php | Centralizes asset/meta/csrf registrations. |
| views/layouts/_header.php | Implements nav items array + logout link using data-method="post". |
| views/layouts/_footer.php | Extracts footer markup and updates formatting. |
| tests/_bootstrap.php | Fixes YII constants setup and adds strict types. |
| tests/Unit/Models/ContactFormTest.php | Updates contact signature usage to pass the mailer + sender details. |
| tests/Unit/LogoutTest.php | Updates controller construction and expected logout link HTML. |
| tests/Unit/LoginTest.php | Updates controller construction for mailer injection. |
| tests/Support/MailerBootstrap.php | Adds bootstrap to bind DI MailerInterface to the app mailer in tests. |
| models/User.php | Adds strict types and typed properties; updates identity method signatures. |
| models/LoginForm.php | Adds strict types and typed properties; refactors cached user loading. |
| models/ContactForm.php | Switches email sending to take MailerInterface + sender details as params. |
| controllers/SiteController.php | Adds constructor mailer injection and updates contact flow to use it. |
| config/web.php | Configures container singleton mailer + maps mailer component to MailerInterface. |
| config/test.php | Adds test bootstrap + tweaks mailer config. |
| config/db.php | Uses ::class constant for DB connection class. |
| config/console.php | Uses ::class constants for components/modules. |
| commands/HelloController.php | Adds strict types and types the action method. |
| assets/AppAsset.php | Adds strict types and replaces string class names with ::class. |
| docs/images/error-light.png | Adds documentation image asset. |
| docs/images/error-dark.png | Adds documentation image asset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 33 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 33 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 35 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.