Passed
Push — master ( ad0973...f9c297 )
by Kacper
02:48
created

Less   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getIdentifier() 0 4 1
A setupRules() 0 10 1
1
<?php
2
/**
3
 * Highlighter
4
 *
5
 * Copyright (C) 2016, Some right reserved.
6
 *
7
 * @author Kacper "Kadet" Donat <[email protected]>
8
 *
9
 * Contact with author:
10
 * Xmpp: [email protected]
11
 * E-mail: [email protected]
12
 *
13
 * From Kadet with love.
14
 */
15
16
namespace Kadet\Highlighter\Language\Css;
17
18
19
use Kadet\Highlighter\Matcher\RegexMatcher;
20
use Kadet\Highlighter\Parser\Rule;
21
22
class Less extends PreProcessor
23
{
24
    /**
25
     * Tokenization rules
26
     *
27
     * @return \Kadet\Highlighter\Parser\Rule[]|\Kadet\Highlighter\Parser\Rule[][]
28
     */
29
    public function setupRules()
30
    {
31
        $rules = parent::setupRules();
32
        $this->rules->add('variable', new Rule(new RegexMatcher('/(@[\w-]+)/'), [
33
            'context'  => ['!comment', '!keyword'],
34
            'priority' => -1
35
        ]));
36
37
        return $rules;
38
    }
39
40
    public function getIdentifier()
41
    {
42
        return 'less';
43
    }
44
}