1. Go to this page and download the library: Download bizley/deep-instantiate 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/ */
bizley / deep-instantiate example snippets
class Alpha implements AlphaInterface
{
private $beta;
public function __construct(BetaInterface $beta)
{
$this->beta = $beta;
}
}
class Beta implements BetaInterface
{
}
class Gamma
{
private $alpha;
public function __construct(AlphaInterface $alpha)
{
$this->alpha = $alpha;
}
}