Skip to content

Commit 4b6d483

Browse files
committed
fix Str::startsWith need string error
1 parent 56813cb commit 4b6d483

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Parameters/Concerns/GeneratesFromRules.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ protected function getParamType(array $paramRules)
1919
{
2020
if (in_array('integer', $paramRules)) {
2121
return 'integer';
22-
} else if (in_array('numeric', $paramRules)) {
22+
} elseif (in_array('numeric', $paramRules)) {
2323
return 'number';
24-
} else if (in_array('boolean', $paramRules)) {
24+
} elseif (in_array('boolean', $paramRules)) {
2525
return 'boolean';
26-
} else if (in_array('array', $paramRules)) {
26+
} elseif (in_array('array', $paramRules)) {
2727
return 'array';
2828
} else {
2929
//date, ip, email, etc..
@@ -62,11 +62,11 @@ protected function getEnumValues(array $paramRules)
6262
private function getInParameter(array $paramRules)
6363
{
6464
foreach ($paramRules as $rule) {
65-
if (Str::startsWith($rule, 'in:')) {
65+
if (is_string($rule) && Str::startsWith($rule, 'in:')) {
6666
return $rule;
6767
}
6868
}
6969

7070
return false;
7171
}
72-
}
72+
}

0 commit comments

Comments
 (0)