Skip to content

Commit 6d391c7

Browse files
Update Container.php
1 parent 5a7d9a0 commit 6d391c7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Container.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ class Container
1717

1818
public static function getInstance()
1919
{
20-
if (!isset(static::$instances)) {
20+
if (!isset(static::$instances))
2121
static::$instances = new self();
22-
}
2322

2423
return static::$instances;
2524
}
@@ -32,18 +31,16 @@ public function bind(string $key, mixed $value): mixed
3231

3332
public function singleton(string $key, object $value)
3433
{
35-
if (!$this->has($key)) {
34+
if (!$this->has($key))
3635
return $this->bind($key, $value);
37-
}
3836

3937
return $this->storage[$key];
4038
}
4139

4240
public function key(string $key)
4341
{
44-
if ($this->has($key)) {
42+
if ($this->has($key))
4543
return $key;
46-
}
4744

4845
throw new \Exception("Key '{$key}' not found in container.");
4946
}

0 commit comments

Comments
 (0)