ParseResult::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
/**
3
 * Dash
4
 *
5
 * @link      http://github.com/DASPRiD/Dash For the canonical source repository
6
 * @copyright 2013-2015 Ben Scholzen 'DASPRiD'
7
 * @license   http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
8
 */
9
10
namespace Dash\Parser;
11
12
/**
13
 * A generic parse result which is returned by parsers.
14
 */
15
class ParseResult
16
{
17
    /**
18
     * @var array
19
     */
20
    protected $params;
21
22
    /**
23
     * @var int
24
     */
25
    protected $matchLength;
26
27
    /**
28
     * @param array $params
29
     * @param int   $matchLength
30
     */
31
    public function __construct(array $params, $matchLength)
32
    {
33
        $this->params      = $params;
34
        $this->matchLength = (int) $matchLength;
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    public function getParams()
41
    {
42
        return $this->params;
43
    }
44
45
    /**
46
     * @return int
47
     */
48
    public function getMatchLength()
49
    {
50
        return $this->matchLength;
51
    }
52
}
53