ReleaseBuildInfo   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 1
cbo 0
dl 0
loc 58
ccs 17
cts 17
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getTitle() 0 4 1
A getOrderNumbersReadyForNextRelease() 0 4 1
A __construct() 0 6 1
A toArray() 0 10 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: k127
5
 * Date: 11.12.15
6
 * Time: 15:49
7
 */
8
9
namespace Manavo\DoneDone;
10
11
/**
12
 * Class ReleaseBuildInfo
13
 * @package Manavo\DoneDone
14
 */
15
class ReleaseBuildInfo
16
{
17
    /** @var int */
18
    private $id = null;
19
    /** @var string */
20
    private $title = null;
21
    /** @var array of int */
22
    private $order_numbers_ready_for_next_release = [];
23
24
    /**
25
     * ReleaseBuildInfo constructor.
26
     * @param array|null $data
27
     */
28 6
    function __construct($data = null)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
29
    {
30 6
        $this->id = $data['id'];
31 6
        $this->title = $data['title'];
32 6
        $this->order_numbers_ready_for_next_release = $data['order_numbers_ready_for_next_release'];
33 6
    }
34
35
    /**
36
     * @return int
37
     */
38 3
    public function getId()
39
    {
40 3
        return $this->id;
41
    }
42
43
    /**
44
     * @return string
45
     */
46 3
    public function getTitle()
47
    {
48 3
        return $this->title;
49
    }
50
51
    /**
52
     * @return array
53
     */
54 3
    public function getOrderNumbersReadyForNextRelease()
55
    {
56 3
        return $this->order_numbers_ready_for_next_release;
57
    }
58
59
    /**
60
     * @return array
61
     */
62 3
    public function toArray()
63
    {
64
        $data = [
65 3
            'id'                                   => $this->id,
66 3
            'title'                                => $this->title,
67 3
            'order_numbers_ready_for_next_release' => $this->order_numbers_ready_for_next_release,
68 3
        ];
69
70 3
        return $data;
71
    }
72
}
73