agent foundation

This commit is contained in:
2026-03-06 00:44:52 +01:00
parent 9819cba733
commit 9a08f96c11
199 changed files with 8522 additions and 1880 deletions

View File

@@ -4,6 +4,8 @@ namespace MintyPHP\App;
use RuntimeException;
// Minimal DI container: factories are registered with set() and resolved lazily on first get().
// Each service is instantiated at most once — get() returns the same instance on every call.
final class AppContainer
{
/** @var array<string, callable(self): mixed> */
@@ -32,6 +34,7 @@ final class AppContainer
throw new RuntimeException('Service not bound: ' . $id);
}
// Resolve, cache, and return — factory receives the container for its own dependencies.
$this->instances[$id] = ($this->bindings[$id])($this);
return $this->instances[$id];
}