Collection   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
dl 0
loc 27
eloc 7
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A offsetExists() 0 3 1
A offsetSet() 0 3 1
A offsetUnset() 0 3 1
A offsetGet() 0 3 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