SimpleResultSet   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 41.18%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 39
ccs 7
cts 17
cp 0.4118
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getIterator() 0 4 1
A count() 0 4 1
A offsetExists() 0 4 1
A offsetGet() 0 4 1
A offsetSet() 0 4 1
A offsetUnset() 0 4 1
1
<?php
2
3
namespace Brouzie\Sphinxy\Query;
4
5
class SimpleResultSet implements \IteratorAggregate, \Countable, \ArrayAccess
6
{
7
    protected $result;
8
9 3
    public function __construct(array $result)
10
    {
11 3
        $this->result = $result;
12 3
    }
13
14 3
    public function getIterator()
15
    {
16 3
        return new \ArrayIterator($this->result);
17
    }
18
19 3
    public function count()
20
    {
21 3
        return count($this->result);
22
    }
23
24
    public function offsetExists($offset)
25
    {
26
        return isset($this->result[$offset]);
27
    }
28
29
    public function &offsetGet($offset)
30
    {
31
        return $this->result[$offset];
32
    }
33
34
    public function offsetSet($offset, $value)
35
    {
36
        $this->result[$offset] = $value;
37
    }
38
39
    public function offsetUnset($offset)
40
    {
41
        unset($this->result[$offset]);
42
    }
43
}
44