1
0
Fork 0

change delimiter to curly braces

pull/4193/head
Rob Bast 2015-06-30 13:51:17 +02:00
parent e698636af4
commit 0298cdc60d
2 changed files with 4 additions and 4 deletions

View File

@ -123,7 +123,7 @@ abstract class BaseExcludeFilter
protected function generatePattern($rule)
{
$negate = false;
$pattern = '#';
$pattern = '{';
if (strlen($rule) && $rule[0] === '!') {
$negate = true;
@ -143,6 +143,6 @@ abstract class BaseExcludeFilter
// remove delimiters as well as caret (^) and dollar sign ($) from the regex
$pattern .= substr(Finder\Glob::toRegex($rule), 2, -2) . '(?=$|/)';
return array($pattern . '#', $negate, false);
return array($pattern . '}', $negate, false);
}
}

View File

@ -29,8 +29,8 @@ class GitExcludeFilterTest extends \PHPUnit_Framework_TestCase
public function patterns()
{
return array(
array('app/config/parameters.yml', array('#(?=[^\.])app/(?=[^\.])config/(?=[^\.])parameters\.yml(?=$|/)#', false, false)),
array('!app/config/parameters.yml', array('#(?=[^\.])app/(?=[^\.])config/(?=[^\.])parameters\.yml(?=$|/)#', true, false)),
array('app/config/parameters.yml', array('{(?=[^\.])app/(?=[^\.])config/(?=[^\.])parameters\.yml(?=$|/)}', false, false)),
array('!app/config/parameters.yml', array('{(?=[^\.])app/(?=[^\.])config/(?=[^\.])parameters\.yml(?=$|/)}', true, false)),
);
}
}