Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Definition / Translator / TranslatedDefinition.php
1 <?php
2
3 /*
4  * This file is part of the Behat.
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\Behat\Definition\Translator;
12
13 use Behat\Behat\Definition\Definition;
14
15 /**
16  * Represents definition translated to the specific language.
17  *
18  * @author Konstantin Kudryashov <ever.zet@gmail.com>
19  */
20 final class TranslatedDefinition implements Definition
21 {
22     /**
23      * @var Definition
24      */
25     private $definition;
26     /**
27      * @var string
28      */
29     private $translatedPattern;
30     /**
31      * @var string
32      */
33     private $language;
34
35     /**
36      * Initialises translated definition.
37      *
38      * @param Definition $definition
39      * @param string     $translatedPattern
40      * @param string     $language
41      */
42     public function __construct(Definition $definition, $translatedPattern, $language)
43     {
44         $this->definition = $definition;
45         $this->translatedPattern = $translatedPattern;
46         $this->language = $language;
47     }
48
49     /**
50      * {@inheritdoc}
51      */
52     public function getType()
53     {
54         return $this->definition->getType();
55     }
56
57     /**
58      * {@inheritdoc}
59      */
60     public function getPattern()
61     {
62         return $this->translatedPattern;
63     }
64
65     /**
66      * Returns original (not translated) pattern.
67      *
68      * @return string
69      */
70     public function getOriginalPattern()
71     {
72         return $this->definition->getPattern();
73     }
74
75     /**
76      * Returns language definition was translated to.
77      *
78      * @return string
79      */
80     public function getLanguage()
81     {
82         return $this->language;
83     }
84
85     /**
86      * {@inheritdoc}
87      */
88     public function getDescription()
89     {
90         return $this->definition->getDescription();
91     }
92
93     /**
94      * {@inheritdoc}
95      */
96     public function getPath()
97     {
98         return $this->definition->getPath();
99     }
100
101     /**
102      * {@inheritdoc}
103      */
104     public function isAMethod()
105     {
106         return $this->definition->isAMethod();
107     }
108
109     /**
110      * {@inheritdoc}
111      */
112     public function isAnInstanceMethod()
113     {
114         return $this->definition->isAnInstanceMethod();
115     }
116
117     /**
118      * {@inheritdoc}
119      */
120     public function getCallable()
121     {
122         return $this->definition->getCallable();
123     }
124
125     /**
126      * {@inheritdoc}
127      */
128     public function getReflection()
129     {
130         return $this->definition->getReflection();
131     }
132
133     /**
134      * {@inheritdoc}
135      */
136     public function __toString()
137     {
138         return $this->definition->__toString();
139     }
140 }