Passed
Branch fuck-54 (18c095)
by Kacper
03:37
created

TokenIterator::sort()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 3
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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\Parser;
17
18
19
class TokenIterator extends \ArrayIterator
20
{
21
    private $_source;
22
23
    /**
24
     * TokenIterator constructor.
25
     *
26
     * @param array  $array
27
     * @param string $source
28
     * @param int    $flags
29
     */
30 16
    public function __construct(array $array, $source, $flags = 0)
31
    {
32 16
        $this->_source = $source;
33
34 16
        parent::__construct($array, $flags);
35 16
    }
36
37 14
    public function getSource()
38
    {
39 14
        return $this->_source;
40
    }
41
42 3
    public function getTokens() {
43 3
        return $this->getArrayCopy();
44
    }
45
}