Преглед изворни кода

change delimiter to curly braces

Rob Bast пре 10 година
родитељ
комит
0298cdc60d

+ 2 - 2
src/Composer/Package/Archiver/BaseExcludeFilter.php

@@ -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);
     }
 }

+ 2 - 2
tests/Composer/Test/Package/Archiver/GitExcludeFilterTest.php

@@ -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)),
         );
     }
 }