Completed
Push — master ( 51cde5...f3ba84 )
by Kacper
02:21
created

TokenIterator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getSource() 0 4 1
A getTokens() 0 3 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
    public function __construct(array $array, $source, $flags = 0)
31
    {
32
        $this->_source = $source;
33
34
        parent::__construct($array, $flags);
35
    }
36
37
    public function getSource()
38
    {
39
        return $this->_source;
40
    }
41
42
    public function getTokens() {
43
        return $this->getArrayCopy();
44
    }
45
}