Open
Conversation
01baafe to
b18dbdc
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the Nette DI bridge and test matrix to support nette/di 3.1 and 3.2 by adapting to Nette\DI\Statement-based dynamic parameters and newer service-reference expectations.
Changes:
- Update
MigrationsExtensionto acceptNette\DI\Statementfor dynamic parameters and to pass service references as strings (@service) for nette/di 3.2 compatibility. - Adjust integration tests to suppress
E_USER_DEPRECATEDduring container compilation and update NEON configs away from deprecated autowiring syntax. - Add CI matrix scripts for nette/di 3.1 and 3.2 with appropriate PHP version ranges.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Bridges/NetteDI/MigrationsExtension.php |
Adds Statement support and switches several internal helpers to return @service reference strings. |
tests/cases/integration/nette-di/MigrationsExtension.phpt |
Suppresses E_USER_DEPRECATED during container compilation in tests. |
tests/cases/integration/nette-di/MigrationsExtension.configC.neon |
Replaces deprecated (...) syntax for DibiAdapter service wiring. |
tests/cases/integration/nette-di/MigrationsExtension.configD.neon |
Replaces deprecated (...) syntax and uses explicit service reference for MySqlDriver. |
tests/cases/integration/nette-di/MigrationsExtension.configE.neon |
Replaces deprecated (...) syntax for DibiAdapter service wiring. |
tests/matrix/nette-di/nette-3.1.sh |
Adds matrix definition for nette/di 3.1 (PHP 8.0–8.3). |
tests/matrix/nette-di/nette-3.2.sh |
Adds matrix definition for nette/di 3.2 (PHP 8.1–8.4). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+303
to
+305
| if ($dir instanceof Statement) { | ||
| $append = function (string $path) use ($dir): Statement { | ||
| return new Statement('? . ?', [$dir, $path]); |
There was a problem hiding this comment.
The array-shape return phpdoc still says directory: string, but directory can now be a PhpLiteral or Statement (via the new $append closure branches). Update the return annotation so it matches the actual possible types to avoid misleading IDE/static analysis output.
8722ca0 to
79b2ec9
Compare
- Fix MigrationsExtension to accept Nette\DI\Statement for dynamic container parameters (nette/di 3.1+ uses Statement instead of PhpLiteral for dynamic parameters) - Return service reference strings instead of ServiceDefinition objects from definition methods (required for nette/di 3.2 compatibility) - Suppress E_USER_DEPRECATED during container compilation in tests to handle deprecation notices from nette/di and doctrine/orm - Replace deprecated `(...)` syntax with autowiring-compatible alternatives in test config files - Add nette-3.1.sh (PHP 8.0-8.3) and nette-3.2.sh (PHP 8.1-8.4) matrix files
79b2ec9 to
7e9f5af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MigrationsExtensionto handleNette\DI\Statementobjects for dynamic container parameters (nette/di 3.1+ changed fromPhpLiteraltoStatement)@service.name) instead ofServiceDefinitionobjects from internal definition methods (required for nette/di 3.2 compatibility)E_USER_DEPRECATEDduring container compilation in tests (handles deprecation notices from nette/di...syntax and doctrine/orm annotations)(...)autowiring syntax in test neon configs with class-name-only or explicit service reference alternatives (compatible with all nette/di versions)nette-3.1.sh(PHP 8.0–8.3) andnette-3.2.sh(PHP 8.1–8.4) matrix filesTest plan