|
|
|
@ -134,7 +134,7 @@ class Container implements \ArrayAccess, ContainerInterface
|
|
|
|
|
*
|
|
|
|
|
* @throws \RuntimeException Prevent override of a frozen service
|
|
|
|
|
*/
|
|
|
|
|
public function offsetSet($id, $value)
|
|
|
|
|
public function offsetSet($id, $value): void
|
|
|
|
|
{
|
|
|
|
|
if (isset($this->frozen[$id])) {
|
|
|
|
|
throw new \RuntimeException(sprintf('Cannot override frozen service "%s".', $id));
|
|
|
|
@ -153,6 +153,7 @@ class Container implements \ArrayAccess, ContainerInterface
|
|
|
|
|
*
|
|
|
|
|
* @throws NotFoundExceptionInterface if the identifier is not defined
|
|
|
|
|
*/
|
|
|
|
|
#[\ReturnTypeWillChange]
|
|
|
|
|
public function offsetGet($id)
|
|
|
|
|
{
|
|
|
|
|
if (!isset($this->keys[$id])) {
|
|
|
|
@ -188,7 +189,7 @@ class Container implements \ArrayAccess, ContainerInterface
|
|
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function offsetExists($id)
|
|
|
|
|
public function offsetExists($id): bool
|
|
|
|
|
{
|
|
|
|
|
return isset($this->keys[$id]);
|
|
|
|
|
}
|
|
|
|
@ -198,7 +199,7 @@ class Container implements \ArrayAccess, ContainerInterface
|
|
|
|
|
*
|
|
|
|
|
* @param string $id The unique identifier for the parameter or object
|
|
|
|
|
*/
|
|
|
|
|
public function offsetUnset($id)
|
|
|
|
|
public function offsetUnset($id): void
|
|
|
|
|
{
|
|
|
|
|
if (isset($this->keys[$id])) {
|
|
|
|
|
if (is_object($this->values[$id])) {
|
|
|
|
|