Security update for permissions_by_term
[yaffs-website] / vendor / behat / gherkin / src / Behat / Gherkin / Node / BackgroundNode.php
1 <?php
2
3 /*
4  * This file is part of the Behat Gherkin.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
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 Background.
15  *
16  * @author Konstantin Kudryashov <ever.zet@gmail.com>
17  */
18 class BackgroundNode implements ScenarioLikeInterface
19 {
20     /**
21      * @var string
22      */
23     private $title;
24     /**
25      * @var StepNode[]
26      */
27     private $steps = array();
28     /**
29      * @var string
30      */
31     private $keyword;
32     /**
33      * @var integer
34      */
35     private $line;
36
37     /**
38      * Initializes background.
39      *
40      * @param null|string $title
41      * @param StepNode[]  $steps
42      * @param string      $keyword
43      * @param integer     $line
44      */
45     public function __construct($title, array $steps, $keyword, $line)
46     {
47         $this->title = $title;
48         $this->steps = $steps;
49         $this->keyword = $keyword;
50         $this->line = $line;
51     }
52
53     /**
54      * Returns node type string
55      *
56      * @return string
57      */
58     public function getNodeType()
59     {
60         return 'Background';
61     }
62
63     /**
64      * Returns background title.
65      *
66      * @return null|string
67      */
68     public function getTitle()
69     {
70         return $this->title;
71     }
72
73     /**
74      * Checks if background has steps.
75      *
76      * @return Boolean
77      */
78     public function hasSteps()
79     {
80         return 0 < count($this->steps);
81     }
82
83     /**
84      * Returns background steps.
85      *
86      * @return StepNode[]
87      */
88     public function getSteps()
89     {
90         return $this->steps;
91     }
92
93     /**
94      * Returns background keyword.
95      *
96      * @return string
97      */
98     public function getKeyword()
99     {
100         return $this->keyword;
101     }
102
103     /**
104      * Returns background declaration line number.
105      *
106      * @return integer
107      */
108     public function getLine()
109     {
110         return $this->line;
111     }
112 }