8000 [DI] Cleanup array_key_exists by ro0NL · Pull Request #19689 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] Cleanup array_key_exists #19689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
lets see what happens for definitions
  • Loading branch information
ro0NL committed Aug 22, 2016
commit 4d76ad755088c702a42052ec1a2e39ac41f4cf6d
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INV
return $service;
}

if (!array_key_exists($id, $this->definitions) && isset($this->aliasDefinitions[$id])) {
if (!isset($this->definitions[$id]) && isset($this->aliasDefinitions[$id])) {
return $this->get($this->aliasDefinitions[$id]);
}

Expand Down Expand Up @@ -784,7 +784,7 @@ public function setDefinition($id, Definition $definition)
*/
public function hasDefinition($id)
{
return array_key_exists(strtolower($id), $this->definitions);
return isset($this->definitions[strtolower($id)]);
}

/**
Expand All @@ -800,7 +800,7 @@ public function getDefinition($id)
{
$id = strtolower($id);

if (!array_key_exists($id, $this->definitions)) {
if (!isset($this->definitions[$id])) {
throw new ServiceNotFoundException($id);
}

Expand Down
0