File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -154,10 +154,23 @@ public function getParamExample(array $param): string
154
154
case self ::TYPE_FILE :
155
155
case self ::TYPE_NUMBER :
156
156
case self ::TYPE_INTEGER :
157
- case self ::TYPE_STRING :
158
- case self ::TYPE_ARRAY :
159
157
$ output .= $ example ;
160
158
break ;
159
+ case self ::TYPE_ARRAY :
160
+ // If array of strings, make sure any sub-strings are escaped
161
+ if (\substr ($ example , 1 , 1 ) === '" ' ) {
162
+ $ start = \substr ($ example , 0 , 2 );
163
+ $ end = \substr ($ example , -2 );
164
+ $ contents = \substr ($ example , 2 , -2 );
165
+ $ contents = \addslashes ($ contents );
166
+ $ output .= $ start . $ contents . $ end ;
167
+ } else {
168
+ $ output .= $ example ;
169
+ }
170
+ break ;
171
+ case self ::TYPE_STRING :
172
+ $ output .= '" ' . \addslashes ($ example ) . '" ' ;
173
+ break ;
161
174
case self ::TYPE_BOOLEAN :
162
175
$ output .= ($ example ) ? 'true ' : 'false ' ;
163
176
break ;
You can’t perform that action at this time.
0 commit comments