8000 merged branch canni/simple_fixes (PR #3252) · symfony/symfony@c6207e4 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit c6207e4

Browse files
committed
merged branch canni/simple_fixes (PR #3252)
Commits ------- d02f172 Code readability fixes, removed unneeded typecasts and checks Discussion ---------- Code readability fixes, removed unneeded typecasts and checks Bug fix: no Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: - Todo: -
2 parents baa63b8 + d02f172 commit c6207e4

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

tests/Symfony/Tests/Component/Form/Extension/Core/EventListener/MergeCollectionListenerCustomArrayObjectTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
namespace Symfony\Tests\Component\Form\Extension\Core\EventListener;
1313

1414
/**
15-
* This class is a hand written simplified version of PHP native `ArrayObject`
16-
* class, to show that it behaves differently than the PHP native implementation.
17-
*/
15+
* This class is a hand written simplified version of PHP native `ArrayObject`
16+
* class, to show that it behaves differently than the PHP native implementation.
17+
*/
1818
class MergeCollectionListenerCustomArrayObjectTest_CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable
1919
{
2020
private $array;
2121

2222
public function __construct(array $array = null)
2323
{
24-
$this->array = (array) ($array ?: array());
24+
$this->array = $array ?: array();
2525
}
2626

2727
public function offsetExists($offset)
@@ -45,9 +45,7 @@ public function offsetSet($offset, $value)
4545

4646
public function offsetUnset($offset)
4747
{
48-
if (array_key_exists($offset, $this->array)) {
49-
unset($this->array[$offset]);
50-
}
48+
unset($this->array[$offset]);
5149
}
5250

5351
public function getIterator()

tests/Symfony/Tests/Component/Validator/Constraints/CollectionValidatorCustomArrayObjectTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
namespace Symfony\Tests\Component\Validator\Constraints;
1313

1414
/**
15-
* This class is a hand written simplified version of PHP native `ArrayObject`
16-
* class, to show that it behaves different than PHP native implementation.
17-
*/
15+
* This class is a hand written simplified version of PHP native `ArrayObject`
16+
* class, to show that it behaves differently than the PHP native implementation.
17+
*/
1818
class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable
1919
{
2020
private $array;
2121

2222
public function __construct(array $array = null)
2323
{
24-
$this->array = (array) ($array ?: array());
24+
$this->array = $array ?: array();
2525
}
2626

2727
public function offsetExists($offset)
@@ -45,9 +45,7 @@ public function offsetSet($offset, $value)
4545

4646
public function offsetUnset($offset)
4747
{
48-
if (array_key_exists($offset, $this->array)) {
49-
unset($this->array[$offset]);
50-
}
48+
unset($this->array[$offset]);
5149
}
5250

5351
public function getIterator()

0 commit comments

Comments
 (0)
0