Merge pull request #466 from bluk/master

Add Travis-CI PHP 7.0 support
This commit is contained in:
Jay
2016-01-11 14:09:18 -06:00
2 changed files with 4 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ php:
- 5.4 - 5.4
- 5.5 - 5.5
- 5.6 - 5.6
- 7.0
- hhvm - hhvm
matrix: matrix:
allow_failures: allow_failures:

View File

@@ -21,6 +21,9 @@ class JsonValidator
{ {
@json_decode($string); @json_decode($string);
if (json_last_error() != JSON_ERROR_NONE) { if (json_last_error() != JSON_ERROR_NONE) {
if ($string === '' || $string === null) {
return true;
}
if ($silent == false) { if ($silent == false) {
//Throw an Exception for string or array //Throw an Exception for string or array
throw new \InvalidArgumentException("Invalid JSON String"); throw new \InvalidArgumentException("Invalid JSON String");