<?php
require_once './autoload.php';
$injector = new \App\Core\IoC\Injector();
//Adding a factory class SingletonObject class which implements a singleton pattern provinding always the same instance
$injector->addFactory('\App\Factory\SingletonObject', new \App\Factory\SingletonObjectFactory());
$instance = $injector->getClassInstance('\App\Service\CompanyService');
var_dump($instance);
$instance->save(array());
|