This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class ParameterGenerator extends AbstractGenerator
30
30
protected $ type ;
31
31
32
32
/**
33
- * @var string| ValueGenerator
33
+ * @var ValueGenerator
34
34
*/
35
35
protected $ defaultValue ;
36
36
@@ -226,7 +226,7 @@ public function setDefaultValue($defaultValue)
226
226
}
227
227
228
228
/**
229
- * @return string
229
+ * @return ValueGenerator
230
230
*/
231
231
public function getDefaultValue ()
232
232
{
@@ -306,16 +306,10 @@ public function generate()
306
306
307
307
$ output .= '$ ' . $ this ->name ;
308
308
309
- if ($ this ->defaultValue !== null ) {
309
+ if ($ this ->defaultValue instanceof ValueGenerator ) {
310
310
$ output .= ' = ' ;
311
- if (is_string ($ this ->defaultValue )) {
312
- $ output .= ValueGenerator::escape ($ this ->defaultValue );
313
- } elseif ($ this ->defaultValue instanceof ValueGenerator) {
314
- $ this ->defaultValue ->setOutputMode (ValueGenerator::OUTPUT_SINGLE_LINE );
315
- $ output .= $ this ->defaultValue ;
316
- } else {
317
- $ output .= $ this ->defaultValue ;
318
- }
311
+ $ this ->defaultValue ->setOutputMode (ValueGenerator::OUTPUT_SINGLE_LINE );
312
+ $ output .= $ this ->defaultValue ;
319
313
}
320
314
321
315
return $ output ;
You can’t perform that action at this time.
0 commit comments