Revert "minor #19689 [DI] Cleanup array_key_exists (ro0NL)"
This reverts commitc89f80a9cd
, reversing changes made to386e5e78b4
.
This commit is contained in:
parent
053d67bcab
commit
ac742dfc48
@ -223,6 +223,7 @@ class Container implements IntrospectableContainerInterface
|
|||||||
if ('service_container' === $id
|
if ('service_container' === $id
|
||||||
|| isset($this->aliases[$id])
|
|| isset($this->aliases[$id])
|
||||||
|| isset($this->services[$id])
|
|| isset($this->services[$id])
|
||||||
|
|| array_key_exists($id, $this->services)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -265,7 +266,7 @@ class Container implements IntrospectableContainerInterface
|
|||||||
$id = $this->aliases[$id];
|
$id = $this->aliases[$id];
|
||||||
}
|
}
|
||||||
// Re-use shared service instance if it exists.
|
// Re-use shared service instance if it exists.
|
||||||
if (isset($this->services[$id])) {
|
if (isset($this->services[$id]) || array_key_exists($id, $this->services)) {
|
||||||
return $this->services[$id];
|
return $this->services[$id];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +348,7 @@ class Container implements IntrospectableContainerInterface
|
|||||||
$id = $this->aliases[$id];
|
$id = $this->aliases[$id];
|
||||||
}
|
}
|
||||||
|
|
||||||
return isset($this->services[$id]);
|
return isset($this->services[$id]) || array_key_exists($id, $this->services);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -436,7 +436,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||||||
return $service;
|
return $service;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($this->definitions[$id]) && isset($this->aliasDefinitions[$id])) {
|
if (!array_key_exists($id, $this->definitions) && isset($this->aliasDefinitions[$id])) {
|
||||||
return $this->get($this->aliasDefinitions[$id]);
|
return $this->get($this->aliasDefinitions[$id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -784,7 +784,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||||||
*/
|
*/
|
||||||
public function hasDefinition($id)
|
public function hasDefinition($id)
|
||||||
{
|
{
|
||||||
return isset($this->definitions[strtolower($id)]);
|
return array_key_exists(strtolower($id), $this->definitions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -800,7 +800,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||||||
{
|
{
|
||||||
$id = strtolower($id);
|
$id = strtolower($id);
|
||||||
|
|
||||||
if (!isset($this->definitions[$id])) {
|
if (!array_key_exists($id, $this->definitions)) {
|
||||||
throw new ServiceNotFoundException($id);
|
throw new ServiceNotFoundException($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user