|
|
|
@ -163,6 +163,16 @@ final class registry { |
|
|
|
final class di { |
|
|
|
final class di { |
|
|
|
|
|
|
|
|
|
|
|
protected $services = []; |
|
|
|
protected $services = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// alias to register |
|
|
|
|
|
|
|
public function set(...$args): void { |
|
|
|
|
|
|
|
$this->register(...$args); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// alias to get_service |
|
|
|
|
|
|
|
public function get(...$args) { |
|
|
|
|
|
|
|
return $this->get_service(...$args); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function register(string $service_name, callable $callable): void { |
|
|
|
public function register(string $service_name, callable $callable): void { |
|
|
|
$this->services[$service_name] = $callable; |
|
|
|
$this->services[$service_name] = $callable; |
|
|
|
|