forked from loafle/openapi-generator-original
Merge pull request #3700 from scop/php
php: Fix syntax error when pattern contains a single quote
This commit is contained in:
@@ -150,7 +150,7 @@ use \{{invokerPackage}}\ObjectSerializer;
|
||||
{{/minimum}}
|
||||
{{#pattern}}
|
||||
if ({{^required}}!is_null(${{paramName}}) && {{/required}}!preg_match("{{{pattern}}}", ${{paramName}})) {
|
||||
throw new \InvalidArgumentException('invalid value for "{{paramName}}" when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}.');
|
||||
throw new \InvalidArgumentException("invalid value for \"{{paramName}}\" when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}.");
|
||||
}
|
||||
{{/pattern}}
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
{{/minimum}}
|
||||
{{#pattern}}
|
||||
if (!preg_match("{{{pattern}}}", ${{name}})) {
|
||||
throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be conform to the pattern {{{pattern}}}.');
|
||||
throw new \InvalidArgumentException("invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}.");
|
||||
}
|
||||
{{/pattern}}
|
||||
{{/hasValidation}}
|
||||
|
||||
Reference in New Issue
Block a user