MENU

Fun & Interesting

Dependency Injection in PHP | Create a Service Container from Scratch | Use PHP-DI

Dave Hollingworth 10,396 1 year ago
Video Not Working? Fix It Now

Learn what dependency injection is, and how to do it in PHP. Please consider supporting my channel: ☕ https://ko-fi.com/davehollingworth Topics covered: • Dependency injection • Service containers • Autowiring • Third-party DI containers like PHP-DI All source code shown is free to download: ‣ https://gist.github.com/daveh/80901d23a6293a7cc4b363d6747b629b Links shown in the video: ‣ https://laravel.com/docs/10.x/container ‣ https://symfony.com/doc/current/components/dependency_injection.html ‣ https://www.php.net/manual/en/reflectionparameter.gettype.php ‣ https://php-di.org/ Videos: ‣ Securely Storing PHP Configuration Settings https://youtu.be/L5E2HSHrDjw Image used in thumbnail: ‣ https://www.freepik.com/icon/uml_9539813 00:00 Introduction 00:22 What is dependency injection? 03:46 Create a DI container 05:27 Autowiring 11:00 Defining services 13:52 Use PHP-DI 15:48 Summary #PHP #dependencyinjection #laravel #symfony

Comment