Passed
Push — master ( 4c697a...778310 )
by Kacper
02:53
created

OpenRule::match()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 8
Ratio 66.67 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 8
loc 12
rs 9.4285
ccs 5
cts 6
cp 0.8333
cc 2
eloc 6
nc 1
nop 1
crap 2.0185
1
<?php
2
/**
3
 * Highlighter
4
 *1
5
 * Copyright (C) 2015, 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\Parser;
17
18
19 View Code Duplication
class OpenRule extends Rule
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
{
21
    /**
22
     * @param $source
23
     *
24
     * @return Token[]
25
     */
26
    public function match($source)
27
    {
28 1
        return array_filter(parent::match($source), function (Token $token) {
29 1
            if ($token->isStart()) {
30 1
                $token->setEnd(null);
31
32 1
                return true;
33
            }
34
35
            return false;
36 1
        });
37
    }
38
}