Badge   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 47
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 4 1
A value() 0 4 1
A attributes() 0 4 1
1
<?php
2
3
namespace Roboc\Menu;
4
5
/**
6
 * Class Badge
7
 * @package Roboc\Menu
8
 */
9
class Badge
10
{
11
    /**
12
     * @var string
13
     */
14
    protected $value;
15
16
    /**
17
     * @var array
18
     */
19
    protected $attributes = [ ];
20
21
    /**
22
     * Badge constructor.
23
     * @param $value
24
     * @param array $attributes
25
     */
26
    public function __construct( $value, array $attributes = [ ] )
27
    {
28
        $this->value = $value;
29
        $this->attributes = $attributes;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function __toString()
36
    {
37
        return (string) $this->value;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function value()
44
    {
45
        return $this->value;
46
    }
47
48
    /**
49
     * @return array
50
     */
51
    public function attributes()
52
    {
53
        return $this->attributes;
54
    }
55
}
56