- Issue created by @kksandr
- Merge request !8969Issue #3464426: fixed AutowireTrait behavior for nullable types β (Open) created by Unnamed author
- Status changed to Needs work
10 months ago 12:14pm 29 July 2024 - πΊπΈUnited States jrockowitz Brooklyn, NY
I ran into this exact issue when dealing with an optional dependency. The suggested solution makes sense to me.
- First commit to issue fork.
- πΊπΈUnited States smustgrave
1) Drupal\KernelTests\Core\DependencyInjection\AutowireTest::testAutowireInvalidDependency Symfony\Component\DependencyInjection\Exception\AutowiringFailedException: Cannot autowire service "Drupal\KernelTests\Core\DependencyInjection\InvalidServiceInterface": argument "$service" of method "Drupal\KernelTests\Core\DependencyInjection\InvalidOptionalDependencyController::_construct()", you should configure its value explicitly. /builds/issue/drupal-3464426/core/lib/Drupal/Core/DependencyInjection/AutowireTrait.php:37 /builds/issue/drupal-3464426/core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php:191 ERRORS! Tests: 4, Assertions: 7, Errors: 1.
Seems like good test coverage