LessRule::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Ortic\Css2Less\tokens;
4
5
/**
6
 * Class LessRule
7
 * @package Ortic\Css2Less\tokens
8
 */
9
class LessRule
10
{
11
    private $selectors = array();
12
    private $tokens = array();
13
14
    /**
15
     * @param $selectors
16
     */
17 16
    public function __construct($selectors)
18
    {
19 16
        $this->selectors = $selectors;
20 16
    }
21
22
    /**
23
     * Add new node to rule
24
     * @param $token
25
     */
26 16
    public function addToken($token)
27
    {
28 16
        $this->tokens[] = $token;
29 16
    }
30
31
    /**
32
     * Returns the list of selectors (e.g. #logo img)
33
     * @return array
34
     */
35 16
    public function getSelectors()
36
    {
37 16
        return $this->selectors;
38
    }
39
40
    /**
41
     * Returns a list of tokens/nodes for the current selector
42
     * @return array
43
     */
44 16
    public function getTokens()
45
    {
46 16
        return $this->tokens;
47
    }
48
}
49