diff --git a/tests/Symfony/Tests/Component/Form/Extension/Core/EventListener/MergeCollectionListenerCustomArrayObjectTest.php b/tests/Symfony/Tests/Component/Form/Extension/Core/EventListener/MergeCollectionListenerCustomArrayObjectTest.php index 59dec2aa0b..f1ab35e635 100644 --- a/tests/Symfony/Tests/Component/Form/Extension/Core/EventListener/MergeCollectionListenerCustomArrayObjectTest.php +++ b/tests/Symfony/Tests/Component/Form/Extension/Core/EventListener/MergeCollectionListenerCustomArrayObjectTest.php @@ -12,16 +12,16 @@ namespace Symfony\Tests\Component\Form\Extension\Core\EventListener; /** -* This class is a hand written simplified version of PHP native `ArrayObject` -* class, to show that it behaves differently than the PHP native implementation. -*/ + * This class is a hand written simplified version of PHP native `ArrayObject` + * class, to show that it behaves differently than the PHP native implementation. + */ class MergeCollectionListenerCustomArrayObjectTest_CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable { private $array; public function __construct(array $array = null) { - $this->array = (array) ($array ?: array()); + $this->array = $array ?: array(); } public function offsetExists($offset) @@ -45,9 +45,7 @@ class MergeCollectionListenerCustomArrayObjectTest_CustomArrayObject implements public function offsetUnset($offset) { - if (array_key_exists($offset, $this->array)) { - unset($this->array[$offset]); - } + unset($this->array[$offset]); } public function getIterator() diff --git a/tests/Symfony/Tests/Component/Validator/Constraints/CollectionValidatorCustomArrayObjectTest.php b/tests/Symfony/Tests/Component/Validator/Constraints/CollectionValidatorCustomArrayObjectTest.php index 1b20da8732..f61c1a99b8 100644 --- a/tests/Symfony/Tests/Component/Validator/Constraints/CollectionValidatorCustomArrayObjectTest.php +++ b/tests/Symfony/Tests/Component/Validator/Constraints/CollectionValidatorCustomArrayObjectTest.php @@ -12,16 +12,16 @@ namespace Symfony\Tests\Component\Validator\Constraints; /** -* This class is a hand written simplified version of PHP native `ArrayObject` -* class, to show that it behaves different than PHP native implementation. -*/ + * This class is a hand written simplified version of PHP native `ArrayObject` + * class, to show that it behaves differently than the PHP native implementation. + */ class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable { private $array; public function __construct(array $array = null) { - $this->array = (array) ($array ?: array()); + $this->array = $array ?: array(); } public function offsetExists($offset) @@ -45,9 +45,7 @@ class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, public function offsetUnset($offset) { - if (array_key_exists($offset, $this->array)) { - unset($this->array[$offset]); - } + unset($this->array[$offset]); } public function getIterator()