Skip to content

Commit 8ed2bbf

Browse files
committed
[Form] Changed isset() to array_key_exists() to be consistent with ParameterBag
1 parent a1d0ff1 commit 8ed2bbf

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ButtonBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ public function getAttributes()
710710
*/
711711
public function hasAttribute($name)
712712
{
713-
return isset($this->attributes[$name]);
713+
return array_key_exists($name, $this->attributes);
714714
}
715715

716716
/**
@@ -723,7 +723,7 @@ public function hasAttribute($name)
723723
*/
724724
public function getAttribute($name, $default = null)
725725
{
726-
return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
726+
return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
727727
}
728728

729729
/**
@@ -785,7 +785,7 @@ public function getOptions()
785785
*/
786786
public function hasOption($name)
787787
{
788-
return isset($this->options[$name]);
788+
return array_key_exists($name, $this->options);
789789
}
790790

791791
/**
@@ -798,7 +798,7 @@ public function hasOption($name)
798798
*/
799799
public function getOption($name, $default = null)
800800
{
801-
return isset($this->options[$name]) ? $this->options[$name] : $default;
801+
return array_key_exists($name, $this->options) ? $this->options[$name] : $default;
802802
}
803803

804804
/**

FormConfigBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,15 +392,15 @@ public function getAttributes()
392392
*/
393393
public function hasAttribute($name)
394394
{
395-
return isset($this->attributes[$name]);
395+
return array_key_exists($name, $this->attributes);
396396
}
397397

398398
/**
399399
* {@inheritdoc}
400400
*/
401401
public function getAttribute($name, $default = null)
402402
{
403-
return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
403+
return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
404404
}
405405

406406
/**
@@ -448,15 +448,15 @@ public function getOptions()
448448
*/
449449
public function hasOption($name)
450450
{
451-
return isset($this->options[$name]);
451+
return array_key_exists($name, $this->options);
452452
}
453453

454454
/**
455455
* {@inheritdoc}
456456
*/
457457
public function getOption($name, $default = null)
458458
{
459-
return isset($this->options[$name]) ? $this->options[$name] : $default;
459+
return array_key_exists($name, $this->options) ? $this->options[$name] : $default;
460460
}
461461

462462
/**

0 commit comments

Comments
 (0)