SimpleResultSet::offsetExists()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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