Completed
Push — master ( 9753fc...bb535b )
by Tijs
03:33
created

Rule   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 5
c 2
b 1
f 0
lcom 0
cbo 0
dl 0
loc 78
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getSelector() 0 4 1
A getProperties() 0 4 1
A getSpecificity() 0 4 1
A getOrder() 0 4 1
A __construct() 0 7 1
1
<?php
2
3
namespace TijsVerkoyen\CssToInlineStyles\Css\Rule;
4
5
use Symfony\Component\CssSelector\Node\Specificity;
6
7
final class Rule
8
{
9
    /**
10
     * @var string
11
     */
12
    private $selector;
13
14
    /**
15
     * @var array
16
     */
17
    private $properties;
18
19
    /**
20
     * @var Specificity
21
     */
22
    private $specificity;
23
24
    /**
25
     * @var integer
26
     */
27
    private $order;
28
29
    /**
30
     * Rule constructor.
31
     *
32
     * @param string      $selector
33
     * @param Property[]  $properties
34
     * @param Specificity $specificity
35
     * @param int         $order
36
     */
37
    public function __construct($selector, array $properties, Specificity $specificity, $order)
38
    {
39
        $this->selector = $selector;
40
        $this->properties = $properties;
41
        $this->specificity = $specificity;
42
        $this->order = $order;
43
    }
44
45
    /**
46
     * Get selector
47
     *
48
     * @return string
49
     */
50
    public function getSelector()
51
    {
52
        return $this->selector;
53
    }
54
55
    /**
56
     * Get properties
57
     *
58
     * @return array
59
     */
60
    public function getProperties()
61
    {
62
        return $this->properties;
63
    }
64
65
    /**
66
     * Get specificity
67
     *
68
     * @return Specificity
69
     */
70
    public function getSpecificity()
71
    {
72
        return $this->specificity;
73
    }
74
75
    /**
76
     * Get order
77
     *
78
     * @return int
79
     */
80
    public function getOrder()
81
    {
82
        return $this->order;
83
    }
84
}
85