Skip to content

Commit

Permalink
Added variable type checking #1120154850798981
Browse files Browse the repository at this point in the history
  • Loading branch information
aman00323 committed Apr 30, 2019
1 parent 6f7b30a commit 238b8a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## 0.1.16
- Added variable type checking in checkbool method, it will only check if it is string.

## 0.1.15
- Callable method return false due to invalid method name.

Expand Down
4 changes: 2 additions & 2 deletions src/ApiBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,11 @@ private function escapeSpecialCharacters(String $string): String

private function checkBool($string)
{
if (!empty($string)) {
if (!empty($string) && gettype($string) === 'string') {
$string = strtolower($string);
$string = (in_array($string, ["true", "false", "1", "0", "yes", "no"], true));
return $string;
}
return $string;

}

Expand Down

0 comments on commit 238b8a0

Please sign in to comment.