@@ -119,7 +119,7 @@ protected function getParameterExtra(string $type, array $parameterRules): array
119119 }
120120
121121 if (Str::startsWith ($ rule , 'regex ' )) {
122- [$ _ , $ value ] = explode (': ' , $ rule );
122+ [$ _ , $ value ] = explode (': ' , $ rule, 2 );
123123 $ extra ['pattern ' ] = trim ($ value );
124124 }
125125 }
@@ -177,7 +177,7 @@ protected function getEnumValues(array $parameterRules): array {
177177 */
178178 protected function getDefaultValue (array $ parameterRules ): ?string {
179179 foreach ($ parameterRules as $ rule ) {
180- if (Str::startsWith ($ rule , 'swagger_default ' )) {
180+ if (( is_string ( $ rule ) || method_exists ( $ rule , ' __toString ' )) && Str::startsWith ($ rule , 'swagger_default ' )) {
181181 [$ key , $ value ] = explode (': ' , $ rule );
182182 return trim ($ value );
183183 }
@@ -192,7 +192,7 @@ protected function getDefaultValue(array $parameterRules): ?string {
192192 */
193193 protected function getMinValue (array $ parameterRules ) {
194194 foreach ($ parameterRules as $ rule ) {
195- if (Str::startsWith ($ rule , 'swagger_min ' )) {
195+ if (( is_string ( $ rule ) || method_exists ( $ rule , ' __toString ' )) && Str::startsWith ($ rule , 'swagger_min ' )) {
196196 [$ key , $ value ] = explode (': ' , $ rule );
197197 return trim ($ value );
198198 }
@@ -207,7 +207,7 @@ protected function getMinValue(array $parameterRules) {
207207 */
208208 protected function getMaxValue (array $ parameterRules ) {
209209 foreach ($ parameterRules as $ rule ) {
210- if (Str::startsWith ($ rule , 'swagger_max ' )) {
210+ if (( is_string ( $ rule ) || method_exists ( $ rule , ' __toString ' )) && Str::startsWith ($ rule , 'swagger_max ' )) {
211211 [$ key , $ value ] = explode (': ' , $ rule );
212212 return trim ($ value );
213213 }
0 commit comments