Total Complexity | 5 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
29 | final class Singletons |
||
30 | { |
||
31 | private $objects = []; |
||
32 | |||
33 | private $context; |
||
34 | |||
35 | public function __construct(Context $context) |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Fetch an object from the Singletons registry, or instantialise it. |
||
42 | * |
||
43 | * @param string $className The name of the class to get as Singleton |
||
44 | * |
||
45 | * @return SingletonInterface |
||
46 | */ |
||
47 | public function get(string $className): SingletonInterface |
||
60 |