Start your All-Access Pass to unlock this challenge
Which of the following is NOT a correct way to use dependency injection:
// src/Service/AnyService.php // ... class AnyService { public function __construct(private CacheInterface $cache) { } }
All of these are correct ways to use dependency injection.
// src/Service/AnyService.php // ... class AnyService { public function someMethod(CacheInterface $cache) { } }
#[Route('/some/page']) public function someAction(CacheInterface $cache) { }