Autowiring
Autowiring, or auto-wiring, is the ability of the framework to inject dependencies, based on the constructor signature.
Autowiring is based on types, in the signature of the controller.
Autowiring is commonly used in dependency injection, DI containers.
Autowiring reduces boilerplate code, enhances type usage and makes refactoring easier.
<?php
class Renderer {
private View $view;
function __construct(View $view) {
$this->view = $view;
}
}
?>