Find logic errors by using shorthand
// symfony likes complicated fuzzy code
// original from
// https://raw.githubusercontent.com/symfony/symfony/master/src/Symfony/Component/Finder/Glob.php
if ($firstByte) {
if ($strictLeadingDot && '.' !== $car) {
$regex .= '(?=[^\.])';
}
$firstByte = false;
}
if ('/' === $car) {
$firstByte = true;
}
...
// same as
if(TRUE === $strictLeadingDot
&& TRUE === $firstByte
&& '.' !== $car)
$regex .= '(?=[^\.])';
$firstByte = '/' === $car;
# think about it!
Comments