Completed
Push — master ( df1f12...4872e5 )
by Lucas
05:42
created

App   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 136
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%
Metric Value
wmc 10
lcom 0
cbo 0
dl 0
loc 136
ccs 24
cts 24
cp 1
rs 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getTranslatableFields() 0 4 1
A getPreTranslatedFields() 0 4 1
A getId() 0 4 1
A getName() 0 4 1
A getShowInMenu() 0 4 1
A getOrder() 0 4 1
A setOrder() 0 4 1
A setId() 0 6 1
A setName() 0 6 1
A setShowInMenu() 0 6 1
1
<?php
2
/**
3
 * Document for representing Apps.
4
 */
5
6
namespace Graviton\CoreBundle\Document;
7
8
use Graviton\I18nBundle\Document\TranslatableDocumentInterface;
9
10
/**
11
 * App
12
 *
13
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
14
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
15
 * @link     http://swisscom.ch
16
 */
17
class App implements TranslatableDocumentInterface
18
{
19
    /**
20
     * @var string app id
21
     */
22
    protected $id;
23
24
    /**
25
     * @var string app Name
26
     */
27
    protected $name;
28
29
    /**
30
     * @var boolean show app in menu
31
     */
32
    protected $showInMenu;
33
34
    /**
35
     * @var int sort order
36
     */
37
    protected $order;
38
39
    /**
40
     * make name translatable
41
     *
42
     * @return string[]
43
     */
44 23
    public function getTranslatableFields()
45
    {
46 23
        return array('name');
47
    }
48
49
    /**
50
     * return pretranslated fields
51
     *
52
     * @return string[]
53
     */
54 16
    public function getPreTranslatedFields()
55
    {
56 16
        return array();
57
    }
58
59
    /**
60
     * Set id
61
     *
62
     * @param string $id id for new document
63
     *
64
     * @return self
65
     */
66 57
    public function setId($id)
67
    {
68 57
        $this->id = $id;
69
70 57
        return $this;
71
    }
72
73
    /**
74
     * Get id
75
     *
76
     * @return string $id
77
     */
78 18
    public function getId()
79
    {
80 18
        return $this->id;
81
    }
82
83
    /**
84
     * Set name
85
     *
86
     * @param string $name name used for display
87
     *
88
     * @return self
89
     */
90 57
    public function setName($name)
91
    {
92 57
        $this->name = $name;
93
94 57
        return $this;
95
    }
96
97
    /**
98
     * Get name
99
     *
100
     * @return string $name
101
     */
102 17
    public function getName()
103
    {
104 17
        return $this->name;
105
    }
106
107
    /**
108
     * Set showInMenu
109
     *
110
     * @param boolean $showInMenu show app in menu
111
     *
112
     * @return self
113
     */
114 57
    public function setShowInMenu($showInMenu)
115
    {
116 57
        $this->showInMenu = $showInMenu;
117
118 57
        return $this;
119
    }
120
121
    /**
122
     * Get showInMenu
123
     *
124
     * @return boolean $showInMenu
125
     */
126 18
    public function getShowInMenu()
0 ignored issues
show
Coding Style introduced by
function getShowInMenu() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
127
    {
128 18
        return $this->showInMenu;
129
    }
130
131
    /**
132
     * Get order
133
     *
134
     * @return int order
135
     */
136 18
    public function getOrder()
137
    {
138 18
        return $this->order;
139
    }
140
141
    /**
142
     * Set order
143
     *
144
     * @param int $order order
145
     *
146
     * @return void
147
     */
148 57
    public function setOrder($order)
149
    {
150 57
        $this->order = $order;
151 57
    }
152
}
153