Collection   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 34
ccs 13
cts 13
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A addItem() 0 4 1
A getItem() 0 4 1
A size() 0 4 1
A isEmpty() 0 4 1
A getInnerArray() 0 4 1
A jsonSerialize() 0 4 1
1
<?php
2
3
namespace Dalen\OWLPacketInterceptor\Packet;
4
5
/**
6
 * Description of Collection
7
 *
8
 * @author danieleorler
9
 */
10
class Collection implements \JsonSerializable
11
{
12
    private $items = array();
13
    
14 9
    public function addItem($obj)
15
    {
16 9
        $this->items[] = $obj;
17 9
    }
18
    
19 2
    public function getItem($id)
20
    {
21 2
        return $this->items[$id];
22
    }
23
    
24 2
    public function size()
25
    {
26 2
        return count($this->items);
27
    }
28
    
29 1
    public function isEmpty()
30
    {
31 1
        return count($this->items) === 0;
32
    }
33
    
34 1
    public function getInnerArray()
35
    {
36 1
        return $this->items;
37
    }
38
39 1
    public function jsonSerialize()
40
    {
41 1
        return $this->items;
42
    }
43
}
44