CS fixes
parent
abbc0e8a4e
commit
598beb240a
|
@ -130,19 +130,14 @@ abstract class BaseExcludeFilter
|
||||||
$rule = ltrim($rule, '!');
|
$rule = ltrim($rule, '!');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($rule !== '') {
|
$firstSlashPosition = strpos($rule, '/');
|
||||||
if ($rule[0] === '/') {
|
if (0 === $firstSlashPosition) {
|
||||||
$pattern = '^/';
|
$pattern = '^/';
|
||||||
} else {
|
} elseif (false === $firstSlashPosition || strlen($rule) - 1 === $firstSlashPosition) {
|
||||||
$first_slash_position = strpos($rule, '/');
|
|
||||||
|
|
||||||
if (false === $first_slash_position || strlen($rule) - 1 === $first_slash_position) {
|
|
||||||
$pattern = '/';
|
$pattern = '/';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$rule = trim($rule, '/');
|
$rule = trim($rule, '/');
|
||||||
}
|
|
||||||
|
|
||||||
// remove delimiters as well as caret (^) and dollar sign ($) from the regex
|
// remove delimiters as well as caret (^) and dollar sign ($) from the regex
|
||||||
$rule = substr(Finder\Glob::toRegex($rule), 2, -2);
|
$rule = substr(Finder\Glob::toRegex($rule), 2, -2);
|
||||||
|
|
Loading…
Reference in New Issue