abschluss

This commit is contained in:
2025-06-20 07:55:37 +00:00
parent 497e6a0bdf
commit 6c2e71dd53
34 changed files with 1370 additions and 382 deletions

View File

@@ -1,19 +0,0 @@
<?php
namespace Blog\Core;
use Exception;
class Container {
private array $instances = [];
public function set(string $key, callable $factory): void {
$this->instances[$key] = $factory;
}
public function get(string $key): mixed {
if(!isset($this->instances[$key])) {
throw new Exception("No instance found for {$key}");
}
return $this->instances[$key]($this);
}
}