Skip to content

Instantly share code, notes, and snippets.

View Samimi-Information-Technology's full-sized avatar

Samimi Samimi-Information-Technology

View GitHub Profile
@daveh
daveh / Container.php
Last active September 7, 2024 05:37
Dependency Injection in PHP (code to accompany https://youtu.be/TqMXzEK0nsA)
<?php
class Container
{
private array $registry = [];
public function set(string $name, Closure $value): void
{
$this->registry[$name] = $value;
}