| @@ 95-102 (lines=8) @@ | ||
| 92 | * @param string $key |
|
| 93 | * @return bool |
|
| 94 | */ |
|
| 95 | public function hasInstance($key): bool |
|
| 96 | { |
|
| 97 | if (isset($this->aliases[$key])) { |
|
| 98 | $key = $this->aliases[$key]; |
|
| 99 | } |
|
| 100 | ||
| 101 | return isset($this->dicObjects[$key]); |
|
| 102 | } |
|
| 103 | ||
| 104 | /** |
|
| 105 | * Get the shared instance of a DIC object |
|
| @@ 178-185 (lines=8) @@ | ||
| 175 | * |
|
| 176 | * @param string $key |
|
| 177 | */ |
|
| 178 | public function destroyInstance($key): void |
|
| 179 | { |
|
| 180 | if (isset($this->aliases[$key])) { |
|
| 181 | $key = $this->aliases[$key]; |
|
| 182 | } |
|
| 183 | ||
| 184 | unset($this->dicObjects[$key]); |
|
| 185 | } |
|
| 186 | ||
| 187 | /** |
|
| 188 | * Destroy all DIC object instances. |
|