Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 6c8c751

Browse files
committed
fixed CS
1 parent 97fb123 commit 6c8c751

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Core/Util/StringUtils.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function equals($knownString, $userInput)
5454
$knownLen = self::safeStrlen($knownString);
5555
$userLen = self::safeStrlen($userInput);
5656

57-
if ($userLen != $knownLen) {
57+
if ($userLen !== $knownLen) {
5858
return false;
5959
}
6060

@@ -69,21 +69,22 @@ public static function equals($knownString, $userInput)
6969
}
7070

7171
/**
72-
* Return the number of bytes in a string
72+
* Returns the number of bytes in a string.
7373
*
7474
* @param string $string The string whose length we wish to obtain
75+
*
7576
* @return int
7677
*/
7778
public static function safeStrlen($string)
7879
{
7980
// Premature optimization
8081
// Since this cannot be changed at runtime, we can cache it
81-
static $func_exists = null;
82-
if ($func_exists === null) {
83-
$func_exists = function_exists('mb_strlen');
82+
static $funcExists = null;
83+
if (null === $funcExists) {
84+
$funcExists = function_exists('mb_strlen');
8485
}
8586

86-
if ($func_exists) {
87+
if ($funcExists) {
8788
return mb_strlen($string, '8bit');
8889
}
8990

0 commit comments

Comments
 (0)