AllianceCollection   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2
Metric Value
wmc 7
lcom 1
cbo 2
dl 0
loc 55
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setPageCount() 0 4 1
A setItems() 0 16 3
A setTotalCount() 0 4 1
A setNext() 0 4 1
A setPrevious() 0 4 1
1
<?php
2
namespace Perry\Representation\Eve\v1;
3
4
use \Perry\Representation\Reference as Reference;
5
use \Perry\Representation\Uri as Uri;
6
use \Perry\Representation\Base as Base;
7
8
class AllianceCollection extends Base
9
{
10
    public $pageCount;
11
12
    public $items = [];
13
14
    public $totalCount;
15
16
    public $next;
17
18
    public $previous;
19
20
    // by Warringer\Types\Long
21
    public function setPageCount($pageCount)
22
    {
23
        $this->pageCount = $pageCount;
24
    }
25
26
    // by Warringer\Types\ArrayType
27
    public function setItems($items)
28
    {
29
        // by Warringer\Types\Dict
30
        $converters = [];
31
        $converters['href'] = function ($value) { return new Reference($value); };
32
33
        $func = function ($value) use($converters) {
34
            $return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS);
35
            $return['href'] = isset($value->{'href'}) ? $converters['href']($value->{'href'}) : null;
36
            return $return;
37
        };
38
39
        foreach ($items as $key => $value) {
40
            $this->items[$key] = $func($value);
41
        }
42
    }
43
44
    // by Warringer\Types\Long
45
    public function setTotalCount($totalCount)
46
    {
47
        $this->totalCount = $totalCount;
48
    }
49
50
    // by Warringer\Types\Reference
51
    public function setNext($next)
52
    {
53
        $this->next = new Reference($next);
54
    }
55
56
    // by Warringer\Types\Reference
57
    public function setPrevious($previous)
58
    {
59
        $this->previous = new Reference($previous);
60
    }
61
62
}
63