diff --git a/README.md b/README.md index e0abf18..3a72248 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Container -Potter Framework Container Interface \ No newline at end of file +Potter Framework Container Implementation \ No newline at end of file diff --git a/composer.json b/composer.json index 8eec0cb..0b95887 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "potter/container", - "description": "Potter Framework Container Interface", + "description": "Potter Framework Container Implementation", "type": "library", "require": { "php": "^8.5", diff --git a/src/Potter/Container/AbstractContainer.php b/src/Potter/Container/AbstractContainer.php new file mode 100644 index 0000000..803aefc --- /dev/null +++ b/src/Potter/Container/AbstractContainer.php @@ -0,0 +1,13 @@ +container[$key]; + } + + final public function has(string $key): bool + { + return array_key_exists($key, $this->container); + } + + final protected function set(string $key, mixed $value): mixed + { + return $this->container[$key] = $value; + } + + final protected function unset(string $key): void + { + unset($this->container[$key]); + } +}