-
Notifications
You must be signed in to change notification settings - Fork 2
fix(app): Update PHPStan annotations and add container configuration file. #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds empty container configuration files for console and web, updates PHPStan annotations in config files, wires the web container into the main web configuration, and updates the changelog with a bug entry. No runtime logic changes except adding the container key to the web config array. Changes
Sequence Diagram(s)sequenceDiagram
participant Bootstrap as Web Bootstrap
participant Cfg as config/web/app.php
participant Ctr as config/web/container.php
participant Out as Final Config
Bootstrap->>Cfg: Load app.php
Cfg->>Ctr: require container.php
Ctr-->>Cfg: returns []
Cfg->>Cfg: Load components/modules/params
Cfg->>Out: Build $config with 'container' => []
note over Out: $config now includes a 'container' key
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #149 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 7 7
===========================================
Files 12 12
Lines 172 172
===========================================
Hits 172 172 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
config/console/container.php (1)
5-5
: Optional: add a phpstan return annotation for clarity.
Add an explicit return type to help static analysis.declare(strict_types=1); +/** @phpstan-return array<string, mixed> */ return [];
config/web/container.php (1)
5-5
: Optional: add a phpstan return annotation (mirrors console).declare(strict_types=1); +/** @phpstan-return array<string, mixed> */ return [];
config/console/app.php (1)
7-10
: Parity suggestion: wire the console container like web.
Keeps console/web configs consistent and ready for DI overrides.Apply near these lines:
/** @phpstan-var array<string, mixed> $components */ $components = require dirname(__DIR__) . '/common/components.php'; +/** @phpstan-var array<string, mixed> $container */ +$container = require __DIR__ . '/container.php'; /** @phpstan-var array<string, mixed> $params */ $params = require dirname(__DIR__) . '/params-console.php';And add to the returned config array:
'bootstrap' => ['log'], 'components' => $components, + 'container' => $container, 'controllerMap' => ['hello' => HelloController::class],
config/web/app.php (1)
9-11
: Optional: tighten phpstan type for $container to array-shape.
Improves autocompletion and catches key typos.-/** @phpstan-var array<string, mixed> $container */ +/** @phpstan-var array{ + definitions?: array<string, mixed>, + singletons?: array<string, mixed> + } $container */ $container = require __DIR__ . '/container.php';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
CHANGELOG.md
(1 hunks)config/console/app.php
(1 hunks)config/console/container.php
(1 hunks)config/web/app.php
(2 hunks)config/web/container.php
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-31T15:34:39.060Z
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#142
File: README.md:0-0
Timestamp: 2025-08-31T15:34:39.060Z
Learning: In yii2-extensions/app-basic project, the dev-road-runner branch is treated as the main configuration branch with no stable releases available. Static badges pointing to dev branches are intentionally used to direct users to the development version.
Applied to files:
CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: codeception / PHP 8.2-windows-2022
- GitHub Check: codeception / PHP 8.1-windows-2022
🔇 Additional comments (6)
config/console/container.php (1)
1-5
: LGTM — minimal, correct container stub for console.config/web/container.php (1)
1-5
: LGTM — minimal, correct container stub for web.config/console/app.php (1)
7-10
: Docblock update is correct and aligns with actual array shapes.config/web/app.php (2)
7-14
: LGTM — phpstan annotations and container wiring look good.Also applies to: 30-30
30-30
: Confirm top-level ‘container’ support is safe
Yii 2.0.11+ added the top-levelcontainer
key in application config (github.com); yourcomposer.json
constraint (^2.0.53|^22
) covers ≥ 2.0.11, so this setting is supported—just runcomposer install
to pull invendor/yiisoft/yii2
.CHANGELOG.md (1)
8-8
: LGTM — concise, accurate changelog entry.
Summary by CodeRabbit