Boolean should be compared strictly

This commit is contained in:
raphi 2015-04-17 09:40:05 +00:00
parent 49e83f12d3
commit 034419f403
2 changed files with 4 additions and 4 deletions

View File

@ -8,11 +8,11 @@ class CardCreator
public function __construct($configration) public function __construct($configration)
{ {
if ($configration == null) { if ($configration === null) {
throw new \Exception('The given $configuration is null!'); throw new \Exception('The given $configuration is null!');
} }
if ($configration instanceof Configuration == false) { if ($configration instanceof Configuration === false) {
throw new \Exception( throw new \Exception(
'The given $configuration is not a valid ' . 'The given $configuration is not a valid ' .
'Configuration object.' 'Configuration object.'

View File

@ -57,7 +57,7 @@ class Configuration
*/ */
public static function evalSeed($seed) public static function evalSeed($seed)
{ {
if ($seed == null || !is_numeric($seed)) { if ($seed === null || !is_numeric($seed)) {
list($usec, $sec) = explode(' ', microtime()); list($usec, $sec) = explode(' ', microtime());
$seed = (float) $sec + ((float) $usec * 100000); $seed = (float) $sec + ((float) $usec * 100000);
} }
@ -69,7 +69,7 @@ class Configuration
*/ */
public static function evalPattern($pattern) public static function evalPattern($pattern)
{ {
if ($pattern == null) { if ($pattern === null) {
$pattern = self::DEFAULT_PATTERN; $pattern = self::DEFAULT_PATTERN;
} }
return $pattern; return $pattern;