1 | <?php |
||
10 | class Configuration |
||
11 | { |
||
12 | /** |
||
13 | * @var boolean |
||
14 | */ |
||
15 | protected $colorsEnabled = true; |
||
16 | |||
17 | /** |
||
18 | * @var boolean |
||
19 | */ |
||
20 | protected $colorsEnableExplicit = false; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $grep = '*.spec.php'; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $reporter = 'spec'; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $path; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $paths; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $configurationFile; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $dsl; |
||
51 | |||
52 | /** |
||
53 | * @var bool |
||
54 | */ |
||
55 | protected $stopOnFailure = false; |
||
56 | |||
57 | public function __construct() |
||
64 | |||
65 | /** |
||
66 | * Set the pattern used to load tests |
||
67 | * |
||
68 | * @param string $grep |
||
69 | * @return $this |
||
70 | */ |
||
71 | public function setGrep($grep) |
||
75 | |||
76 | /** |
||
77 | * Returns the pattern used to load tests |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getGrep() |
||
85 | |||
86 | /** |
||
87 | * Set the name of the reporter to use |
||
88 | * |
||
89 | * @param string $reporter |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function setReporter($reporter) |
||
96 | |||
97 | /** |
||
98 | * Return the name of the reporter configured for use |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | public function getReporter() |
||
106 | |||
107 | /** |
||
108 | * Set the path to load tests from |
||
109 | * |
||
110 | * @param string $path |
||
111 | * @return $this |
||
112 | */ |
||
113 | public function setPath($path) |
||
117 | |||
118 | /** |
||
119 | * Return the path being searched for tests |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getPath() |
||
127 | |||
128 | /** |
||
129 | * Set the paths to load tests from |
||
130 | * |
||
131 | * @param array $paths |
||
132 | * @return $this |
||
133 | */ |
||
134 | public function setPaths(array $paths) |
||
142 | |||
143 | /** |
||
144 | * Return the paths being searched for tests |
||
145 | * |
||
146 | * @return array |
||
147 | */ |
||
148 | public function getPaths() |
||
152 | |||
153 | /** |
||
154 | * Disable output colors |
||
155 | * |
||
156 | * @return $this |
||
157 | */ |
||
158 | public function disableColors() |
||
166 | |||
167 | /** |
||
168 | * Force output colors even without TTY support. |
||
169 | * |
||
170 | * @return $this |
||
171 | */ |
||
172 | public function enableColorsExplicit() |
||
178 | |||
179 | /** |
||
180 | * Check if output colors are disabled |
||
181 | * |
||
182 | * @return boolean |
||
183 | */ |
||
184 | public function areColorsEnabled() |
||
188 | |||
189 | /** |
||
190 | * Check if output colors are explicitly enabled. |
||
191 | * |
||
192 | * @return boolean |
||
193 | */ |
||
194 | public function areColorsEnabledExplicit() |
||
198 | |||
199 | /** |
||
200 | * Stop the suite runner when a failure occurs |
||
201 | * |
||
202 | * @return $this |
||
203 | */ |
||
204 | public function stopOnFailure() |
||
208 | |||
209 | /** |
||
210 | * Check if the suite runner should stop on failure |
||
211 | * |
||
212 | * @return bool |
||
213 | */ |
||
214 | public function shouldStopOnFailure() |
||
218 | |||
219 | /** |
||
220 | * Set the path to a Peridot configuration file |
||
221 | * |
||
222 | * @param string $configurationFile |
||
223 | * @return $this |
||
224 | */ |
||
225 | public function setConfigurationFile($configurationFile) |
||
238 | |||
239 | /** |
||
240 | * Return the path to the Peridot configuration file. Returns a relative |
||
241 | * path if it exists, otherwise return the provided value |
||
242 | * |
||
243 | * @return string |
||
244 | */ |
||
245 | public function getConfigurationFile() |
||
249 | |||
250 | /** |
||
251 | * Set the path to a DSL file for defining |
||
252 | * the test language used |
||
253 | * |
||
254 | * @param string $dsl |
||
255 | * @return $this |
||
256 | */ |
||
257 | public function setDsl($dsl) |
||
261 | |||
262 | /** |
||
263 | * Get the path to a DSL file containing |
||
264 | * test functions to use |
||
265 | * |
||
266 | * @return string |
||
267 | */ |
||
268 | public function getDsl() |
||
272 | |||
273 | /** |
||
274 | * Write a configuration value and persist it to the current |
||
275 | * environment. |
||
276 | * |
||
277 | * @param string $varName |
||
278 | * @param string $value |
||
279 | * @return $this |
||
280 | */ |
||
281 | protected function write($varName, $value) |
||
289 | |||
290 | /** |
||
291 | * Write the paths and persist them to the current environment. |
||
292 | * |
||
293 | * @param array $paths |
||
294 | * @return $this |
||
295 | */ |
||
296 | protected function writePaths(array $paths) |
||
303 | } |
||
304 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: