Completed
Pull Request — master (#112)
by Christophe
02:45
created

ExampleTableNode::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Behat Gherkin.
5
 * (c) Konstantin Kudryashov <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Behat\Gherkin\Node;
12
13
/**
14
 * Represents Gherkin Outline Example Table.
15
 *
16
 * @author Konstantin Kudryashov <[email protected]>
17
 */
18
class ExampleTableNode extends TableNode
19
{
20
    /**
21
     * @var string
22
     */
23
    private $keyword;
24
25
    /**
26
     * Initializes example table.
27
     *
28
     * @param array  $table   Table in form of [$rowLineNumber => [$val1, $val2, $val3]]
29
     * @param string $keyword
30
     */
31 34
    public function __construct(array $table, $keyword)
32
    {
33 34
        $this->keyword = $keyword;
34
35 34
        parent::__construct($table);
36 34
    }
37
38
    /**
39
     * Returns node type string
40
     *
41
     * @return string
42
     */
43
    public function getNodeType()
44
    {
45
        return 'ExampleTable';
46
    }
47
48
    /**
49
     * Returns example table keyword.
50
     *
51
     * @return string
52
     */
53 2
    public function getKeyword()
54
    {
55 2
        return $this->keyword;
56
    }
57
}
58