Permalink
Browse files

CS: Unified strict equality comparisons, put var on the right side

  • Loading branch information...
1 parent 28c880f commit 7d3565e4342914d9a5bce4836b1a6edb397666f3 @Seldaek Seldaek committed with fabpot Dec 21, 2010
Showing with 9 additions and 9 deletions.
  1. +9 −9 Glob.php
View
@@ -52,36 +52,36 @@ static public function toRegex($glob, $strictLeadingDot = true, $strictWildcardS
for ($i = 0; $i < $sizeGlob; $i++) {
$car = $glob[$i];
if ($firstByte) {
- if ($strictLeadingDot && $car !== '.') {
+ if ($strictLeadingDot && '.' !== $car) {
$regex .= '(?=[^\.])';
}
$firstByte = false;
}
- if ($car === '/') {
+ if ('/' === $car) {
$firstByte = true;
}
- if ($car === '.' || $car === '(' || $car === ')' || $car === '|' || $car === '+' || $car === '^' || $car === '$') {
+ if ('.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) {
$regex .= "\\$car";
- } elseif ($car === '*') {
+ } elseif ('*' === $car) {
$regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*');
- } elseif ($car === '?') {
+ } elseif ('?' === $car) {
$regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.');
- } elseif ($car === '{') {
+ } elseif ('{' === $car) {
$regex .= $escaping ? '\\{' : '(';
if (!$escaping) {
++$inCurlies;
}
- } elseif ($car === '}' && $inCurlies) {
+ } elseif ('}' === $car && $inCurlies) {
$regex .= $escaping ? '}' : ')';
if (!$escaping) {
--$inCurlies;
}
- } elseif ($car === ',' && $inCurlies) {
+ } elseif (',' === $car && $inCurlies) {
$regex .= $escaping ? ',' : '|';
- } elseif ($car === '\\') {
+ } elseif ('\\' === $car) {
if ($escaping) {
$regex .= '\\\\';
$escaping = false;

0 comments on commit 7d3565e

Please sign in to comment.