Boolean should be compared strictly
This commit is contained in:
parent
49e83f12d3
commit
034419f403
2 changed files with 4 additions and 4 deletions
|
@ -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.'
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Reference in a new issue