@@ -32,11 +32,13 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function get($id) |
| 34 | 34 | { |
| 35 | - if (!is_string($id)) |
|
| 36 | - throw new ContainerException('Given ID must be a string'); |
|
| 35 | + if (!is_string($id)) { |
|
| 36 | + throw new ContainerException('Given ID must be a string'); |
|
| 37 | + } |
|
| 37 | 38 | |
| 38 | - if (!$this->has($id)) |
|
| 39 | - throw new NotFoundException(); |
|
| 39 | + if (!$this->has($id)) { |
|
| 40 | + throw new NotFoundException(); |
|
| 41 | + } |
|
| 40 | 42 | |
| 41 | 43 | return $this->storedComponents[$id]; |
| 42 | 44 | } |
@@ -46,8 +48,9 @@ discard block |
||
| 46 | 48 | */ |
| 47 | 49 | public function has($id) |
| 48 | 50 | { |
| 49 | - if (!is_string($id)) |
|
| 50 | - throw new ContainerException('Given ID must be a string'); |
|
| 51 | + if (!is_string($id)) { |
|
| 52 | + throw new ContainerException('Given ID must be a string'); |
|
| 53 | + } |
|
| 51 | 54 | |
| 52 | 55 | return array_key_exists($id, $this->storedComponents); |
| 53 | 56 | } |