Collection::__construct()   A
last analyzed

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
c 1
b 0
f 0
dl 0
loc 3
eloc 1
rs 10
nc 1
nop 1
cc 1
1
<?php
2
3
namespace MathieuTu\Exporter\Tests\Fixtures;
4
5
class Collection implements \ArrayAccess
6
{
7
    private $attributes;
8
9
    public function __construct(array $attributes)
10
    {
11
        $this->attributes = $attributes;
12
    }
13
14
    public function offsetExists($offset): bool
15
    {
16
        return isset($this->attributes[$offset]);
17
    }
18
19
    public function offsetGet($offset)
20
    {
21
        return $this->attributes[$offset];
22
    }
23
24
    public function offsetSet($offset, $value)
25
    {
26
        return $this->attributes[$offset] = $value;
27
    }
28
29
    public function offsetUnset($offset)
30
    {
31
        unset($this->attributes[$offset]);
32
    }
33
}
34