mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-19 07:07:58 +08:00
Use === instead of == where possible
This commit is contained in:
@@ -523,7 +523,7 @@ class BaseFileHelper
|
||||
private static function matchPathname($path, $basePath, $pattern, $firstWildcard, $flags)
|
||||
{
|
||||
// match with FNM_PATHNAME; the pattern has base implicitly in front of it.
|
||||
if (isset($pattern[0]) && $pattern[0] == '/') {
|
||||
if (isset($pattern[0]) && $pattern[0] === '/') {
|
||||
$pattern = StringHelper::byteSubstr($pattern, 1, StringHelper::byteLength($pattern));
|
||||
if ($firstWildcard !== false && $firstWildcard !== 0) {
|
||||
$firstWildcard--;
|
||||
@@ -631,11 +631,11 @@ class BaseFileHelper
|
||||
return $result;
|
||||
}
|
||||
|
||||
if ($pattern[0] == '!') {
|
||||
if ($pattern[0] === '!') {
|
||||
$result['flags'] |= self::PATTERN_NEGATIVE;
|
||||
$pattern = StringHelper::byteSubstr($pattern, 1, StringHelper::byteLength($pattern));
|
||||
}
|
||||
if (StringHelper::byteLength($pattern) && StringHelper::byteSubstr($pattern, -1, 1) == '/') {
|
||||
if (StringHelper::byteLength($pattern) && StringHelper::byteSubstr($pattern, -1, 1) === '/') {
|
||||
$pattern = StringHelper::byteSubstr($pattern, 0, -1);
|
||||
$result['flags'] |= self::PATTERN_MUSTBEDIR;
|
||||
}
|
||||
@@ -643,7 +643,7 @@ class BaseFileHelper
|
||||
$result['flags'] |= self::PATTERN_NODIR;
|
||||
}
|
||||
$result['firstWildcard'] = self::firstWildcardInPattern($pattern);
|
||||
if ($pattern[0] == '*' && self::firstWildcardInPattern(StringHelper::byteSubstr($pattern, 1, StringHelper::byteLength($pattern))) === false) {
|
||||
if ($pattern[0] === '*' && self::firstWildcardInPattern(StringHelper::byteSubstr($pattern, 1, StringHelper::byteLength($pattern))) === false) {
|
||||
$result['flags'] |= self::PATTERN_ENDSWITH;
|
||||
}
|
||||
$result['pattern'] = $pattern;
|
||||
|
||||
Reference in New Issue
Block a user