Dependency Injection (DI) enables classes to be relieved from the task of creating objects they depend on. These dependent objects are termed services. Comprehensive documentation is available at the official Nette website.
To set up the example:
git clone https://github.com/nette-examples/di-example-doc
cd di-example-doc
composer install
Execute the demo using:
php example.php
This demo is compatible with PHP version 8.1 or newer.