[Form] Changed isset() to array_key_exists() to be consistent with ParameterBag

This commit is contained in:
Bernhard Schussek 2013-01-03 19:09:17 +01:00
parent 7b438a816b
commit 7b07925fad
2 changed files with 8 additions and 8 deletions

View File

@ -710,7 +710,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
*/
public function hasAttribute($name)
{
return isset($this->attributes[$name]);
return array_key_exists($name, $this->attributes);
}
/**
@ -723,7 +723,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
*/
public function getAttribute($name, $default = null)
{
return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
}
/**
@ -785,7 +785,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
*/
public function hasOption($name)
{
return isset($this->options[$name]);
return array_key_exists($name, $this->options);
}
/**
@ -798,7 +798,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
*/
public function getOption($name, $default = null)
{
return isset($this->options[$name]) ? $this->options[$name] : $default;
return array_key_exists($name, $this->options) ? $this->options[$name] : $default;
}
/**

View File

@ -392,7 +392,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface
*/
public function hasAttribute($name)
{
return isset($this->attributes[$name]);
return array_key_exists($name, $this->attributes);
}
/**
@ -400,7 +400,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface
*/
public function getAttribute($name, $default = null)
{
return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
}
/**
@ -448,7 +448,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface
*/
public function hasOption($name)
{
return isset($this->options[$name]);
return array_key_exists($name, $this->options);
}
/**
@ -456,7 +456,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface
*/
public function getOption($name, $default = null)
{
return isset($this->options[$name]) ? $this->options[$name] : $default;
return array_key_exists($name, $this->options) ? $this->options[$name] : $default;
}
/**