File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,10 @@ public function offsetExists($offset): bool
44
44
*/
45
45
public function offsetGet ($ offset ): mixed
46
46
{
47
- assert ($ offset === 0 || $ offset === 1 );
48
-
49
47
return match ($ offset ) {
50
48
0 => $ this ->value ,
51
49
1 => $ this ->parameters ,
50
+ default => null ,
52
51
};
53
52
}
54
53
@@ -58,8 +57,6 @@ public function offsetGet($offset): mixed
58
57
*/
59
58
public function offsetSet ($ offset , $ value ): void
60
59
{
61
- assert ($ offset === 0 || $ offset === 1 );
62
-
63
60
if ($ offset === 0 ) {
64
61
$ this ->value = $ value ;
65
62
} elseif ($ offset === 1 ) {
@@ -75,8 +72,6 @@ public function offsetSet($offset, $value): void
75
72
*/
76
73
public function offsetUnset ($ offset ): void
77
74
{
78
- assert ($ offset === 0 || $ offset === 1 );
79
-
80
75
if ($ offset === 0 ) {
81
76
$ this ->value = null ;
82
77
} elseif ($ offset === 1 ) {
Original file line number Diff line number Diff line change @@ -54,13 +54,7 @@ public function testArrayIndexIsset(): void
54
54
public function testArrayOutOfBounds (): void
55
55
{
56
56
$ item = new Item (true );
57
- try {
58
- $ this ->assertEmpty ($ item [2 ]); // @phpstan-ignore-line
59
- } catch (\AssertionError ) { // @phpstan-ignore-line
60
- $ this ->addToAssertionCount (1 );
61
- return ;
62
- }
63
- $ this ->fail ();
57
+ $ this ->assertEmpty ($ item [2 ]); // @phpstan-ignore-line
64
58
}
65
59
66
60
public function testArrayUnset (): void
You can’t perform that action at this time.
0 commit comments