Micro-optimization
This commit is contained in:
parent
2d2b9bc1d0
commit
5377290fbf
@ -746,7 +746,7 @@ EOF;
|
||||
{
|
||||
\$name = strtolower(\$name);
|
||||
|
||||
if (!array_key_exists(\$name, \$this->parameters)) {
|
||||
if (!(isset(\$this->parameters[\$name]) || array_key_exists(\$name, \$this->parameters))) {
|
||||
throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', \$name));
|
||||
}
|
||||
|
||||
@ -758,7 +758,9 @@ EOF;
|
||||
*/
|
||||
public function hasParameter(\$name)
|
||||
{
|
||||
return array_key_exists(strtolower(\$name), \$this->parameters);
|
||||
\$name = strtolower(\$name);
|
||||
|
||||
return isset(\$this->parameters[\$name]) || array_key_exists(\$name, \$this->parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -55,7 +55,7 @@ class ProjectServiceContainer extends Container
|
||||
{
|
||||
$name = strtolower($name);
|
||||
|
||||
if (!array_key_exists($name, $this->parameters)) {
|
||||
if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) {
|
||||
throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
|
||||
}
|
||||
|
||||
@ -67,7 +67,9 @@ class ProjectServiceContainer extends Container
|
||||
*/
|
||||
public function hasParameter($name)
|
||||
{
|
||||
return array_key_exists(strtolower($name), $this->parameters);
|
||||
$name = strtolower($name);
|
||||
|
||||
return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -191,7 +191,7 @@ class ProjectServiceContainer extends Container
|
||||
{
|
||||
$name = strtolower($name);
|
||||
|
||||
if (!array_key_exists($name, $this->parameters)) {
|
||||
if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) {
|
||||
throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
|
||||
}
|
||||
|
||||
@ -203,7 +203,9 @@ class ProjectServiceContainer extends Container
|
||||
*/
|
||||
public function hasParameter($name)
|
||||
{
|
||||
return array_key_exists(strtolower($name), $this->parameters);
|
||||
$name = strtolower($name);
|
||||
|
||||
return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user