Security update for permissions_by_term
[yaffs-website] / vendor / behat / gherkin / src / Behat / Gherkin / Node / PyStringNode.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 PyString argument.
15  *
16  * @author Konstantin Kudryashov <ever.zet@gmail.com>
17  */
18 class PyStringNode implements ArgumentInterface
19 {
20     /**
21      * @var array
22      */
23     private $strings = array();
24     /**
25      * @var integer
26      */
27     private $line;
28
29     /**
30      * Initializes PyString.
31      *
32      * @param array   $strings String in form of [$stringLine]
33      * @param integer $line    Line number where string been started
34      */
35     public function __construct(array $strings, $line)
36     {
37         $this->strings = $strings;
38         $this->line = $line;
39     }
40
41     /**
42      * Returns node type.
43      *
44      * @return string
45      */
46     public function getNodeType()
47     {
48         return 'PyString';
49     }
50
51     /**
52      * Returns entire PyString lines set.
53      *
54      * @return array
55      */
56     public function getStrings()
57     {
58         return $this->strings;
59     }
60
61     /**
62      * Returns raw string.
63      *
64      * @return string
65      */
66     public function getRaw()
67     {
68         return implode("\n", $this->strings);
69     }
70
71     /**
72      * Converts PyString into string.
73      *
74      * @return string
75      */
76     public function __toString()
77     {
78         return $this->getRaw();
79     }
80
81     /**
82      * Returns line number at which PyString was started.
83      *
84      * @return integer
85      */
86     public function getLine()
87     {
88         return $this->line;
89     }
90 }