diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2015-03-25 10:29:39 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-03-25 10:29:39 +0100 |
commit | 6c8c751f7f5b09dbb608d4f43518dcb3fb214057 (patch) | |
tree | 6faedf8bbbb900efe671da97882f498bf578e2a0 | |
parent | 97fb12392c702d916538e162954dbca5ffc6a1a3 (diff) | |
download | symfony-security-6c8c751f7f5b09dbb608d4f43518dcb3fb214057.zip symfony-security-6c8c751f7f5b09dbb608d4f43518dcb3fb214057.tar.gz symfony-security-6c8c751f7f5b09dbb608d4f43518dcb3fb214057.tar.bz2 |
fixed CS
-rw-r--r-- | Core/Util/StringUtils.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Core/Util/StringUtils.php b/Core/Util/StringUtils.php index c44176a..e68347f 100644 --- a/Core/Util/StringUtils.php +++ b/Core/Util/StringUtils.php @@ -54,7 +54,7 @@ class StringUtils $knownLen = self::safeStrlen($knownString); $userLen = self::safeStrlen($userInput); - if ($userLen != $knownLen) { + if ($userLen !== $knownLen) { return false; } @@ -69,21 +69,22 @@ class StringUtils } /** - * Return the number of bytes in a string + * Returns the number of bytes in a string. * * @param string $string The string whose length we wish to obtain + * * @return int */ public static function safeStrlen($string) { // Premature optimization // Since this cannot be changed at runtime, we can cache it - static $func_exists = null; - if ($func_exists === null) { - $func_exists = function_exists('mb_strlen'); + static $funcExists = null; + if (null === $funcExists) { + $funcExists = function_exists('mb_strlen'); } - if ($func_exists) { + if ($funcExists) { return mb_strlen($string, '8bit'); } |