1. Go to this page and download the library: Download code-distortion/di-caller library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
code-distortion / di-caller example snippets
use CodeDistortion\DICaller\DICaller;
$callable = fn(Request $request, User $user) => "hello $user->name ({$request->getIp()})";
$user = new User();
$request = new Request();
$shoppingCart = new ShoppingCart();
$result = DICaller::new($callable)
->registerByType($user) // <<<
->registerByType($request) // <<<
->registerByType($shoppingCart) // <<<
->call(); // 'hello Bob (192.168.1.1)'