1. Go to this page and download the library: Download mohamed-amine/ioc-container 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/ */
mohamed-amine / ioc-container example snippets
IOC\IOC::createContainer();
IOC\IOC::container()->build('namespace\MyClass');
// instead of doing this
new MyClass(new ClassA(), new ClassB());
// you can just do this and it will create ClassA & ClassB and pass them automatically
IOC\IOC::container()->build('namespace\MyClass');
...
public function __constructor(ClassA $classa, ClassB $classb) {...}
...