Passed
Push — main ( 6c9276...76dcd0 )
by Anatoly
06:53 queued 02:07
created

Collection::offsetUnset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Sunrise\Hydrator\Tests\Stub;
6
7
use ArrayAccess;
8
use ReturnTypeWillChange;
9
10
class Collection implements ArrayAccess
11
{
12
    public array $elements = [];
13
14
    public function offsetExists($offset): bool
15
    {
16
        return isset($this->elements[$offset]);
17
    }
18
19
    #[ReturnTypeWillChange]
20
    public function offsetGet($offset)
21
    {
22
        return $this->elements[$offset] ?? null;
23
    }
24
25
    public function offsetSet($offset, $value): void
26
    {
27
        $this->elements[$offset] = $value;
28
    }
29
30
    public function offsetUnset($offset): void
31
    {
32
        unset($this->elements[$offset]);
33
    }
34
}
35