14 private static $services = [];
22 private function get(
string $class_name)
24 if (!isset(self::$services[$class_name])) {
25 self::$services[$class_name] =
new $class_name();
28 return self::$services[$class_name];
39 if (!isset(self::$services[$class_name])) {
40 self::$services[$class_name] =
new $class_name($argument);
43 return self::$services[$class_name];
getWithArgument(string $class_name, $argument)