Skip to content

Commit

Permalink
Merge pull request #20 from Local-Data-Exchange/added_variable_type_c…
Browse files Browse the repository at this point in the history
…heck

Added variable type checking #1120154850798981
  • Loading branch information
munir131 authored May 1, 2019
2 parents 6f7b30a + 238b8a0 commit 55a5cd8
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 55a5cd8

Please sign in to comment.