Skip to content

Commit

Permalink
Using language construct instead of function call
Browse files Browse the repository at this point in the history
  • Loading branch information
hollodotme committed Mar 28, 2016
1 parent d6892e4 commit fda2491
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 43 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,7 @@ language: php
php:
- 5.5
- 5.6
- 7.0

branches:
only:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG

## Changes in Version 1.3.1

* Fixed issue #1

## Changes in Version 1.3.0

* Introduced `ifPassed( $continue )` method for a conditional continue of x further checks, only if all previous checks passed so far.
Expand Down
2 changes: 1 addition & 1 deletion build/tools/update_tools.sh
Expand Up @@ -3,7 +3,7 @@
# Absolute path to this script, e.g. /home/user/bin/foo.sh
cd "$(dirname "$0")"

for pharFile in `ls -1 *.phar`; do rm -rf "$pharFile"; done
rm -rf ./*.phar

# Composer
rm -f composer.phar
Expand Down
79 changes: 41 additions & 38 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/FluidValidator.php
Expand Up @@ -291,7 +291,7 @@ private function checkNullCondition( $methodName, $var )
$value = $this->getValue( $var );
$optional = (substr( $methodName, -6 ) == 'OrNull');

return ($optional && is_null( $value ));
return ($optional && ($value === null));
}

/**
Expand Down Expand Up @@ -561,7 +561,7 @@ protected function checkIsNotSame( $value1, $value2 )
*/
protected function checkIsNull( $value )
{
return is_null( $this->getValue( $value ) );
return ($this->getValue( $value ) === null);
}

/**
Expand All @@ -571,7 +571,7 @@ protected function checkIsNull( $value )
*/
protected function checkIsNotNull( $value )
{
return !is_null( $this->getValue( $value ) );
return ($this->getValue( $value ) !== null);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Validators/StringValidator.php
Expand Up @@ -190,7 +190,7 @@ public function isJson( $value )
{
$val = strval( $value );

if ( !is_null( json_decode( $val ) ) && json_last_error() === JSON_ERROR_NONE )
if ( (json_decode( $val ) !== null) && json_last_error() === JSON_ERROR_NONE )
{
return true;
}
Expand Down

0 comments on commit fda2491

Please sign in to comment.