File tree Expand file tree Collapse file tree 5 files changed +25
-58
lines changed
src/VerbalExpressions/PHPVerbalExpressions
tests/VerbalExpressions/PHPVerbalExpressions Expand file tree Collapse file tree 5 files changed +25
-58
lines changed Original file line number Diff line number Diff line change
1
+ language : php
2
+ php :
3
+ - ' 5.3'
4
+ - ' 5.4'
5
+ - ' 5.5'
6
+ - ' 5.6'
7
+ - ' 7.0'
8
+ - hhvm
9
+ - nightly
10
+ before_script :
11
+ - composer install
12
+ script :
13
+ - vendor/bin/php-cs-fixer fix --level=psr2 --dry-run src
14
+ - vendor/bin/php-cs-fixer fix --level=psr2 --dry-run tests
Original file line number Diff line number Diff line change 1
- ##PHPVerbalExpressions
1
+ [ ![ Build Status] ( https://travis-ci.org/VerbalExpressions/PHPVerbalExpressions.svg )] ( https://travis-ci.org/VerbalExpressions/PHPVerbalExpressions )
2
+
3
+ ##PHPVerbalExpressions
2
4
- ported from [ VerbalExpressions] ( https://github.com/VerbalExpressions/JSVerbalExpressions )
3
5
4
6
VerbalExpressions is a PHP library that helps to construct hard regular expressions.
Original file line number Diff line number Diff line change 4
4
"type" : " project" ,
5
5
"description" : " PHP Regular expressions made easy" ,
6
6
"require" : {
7
+ "php" : " >=5.3" ,
8
+ "fabpot/php-cs-fixer" : " ^1.11"
7
9
},
8
10
"require-dev" : {
9
- "phpunit/phpunit" : " ^5.1 "
11
+ "phpunit/phpunit" : " * >=4 "
10
12
},
11
13
"suggest" : {
12
14
"fabpot/php-cs-fixer" : " PHP CS Fixer (testing for PSR-2 compliance)"
Original file line number Diff line number Diff line change @@ -491,12 +491,12 @@ public function clean(array $options = array())
491
491
{
492
492
$ options = array_merge (
493
493
array (
494
- 'prefixes ' => '' ,
495
- 'source ' => '' ,
496
- 'suffixes ' => '' ,
497
- 'modifiers ' => 'gm ' ,
494
+ 'prefixes ' => '' ,
495
+ 'source ' => '' ,
496
+ 'suffixes ' => '' ,
497
+ 'modifiers ' => 'gm ' ,
498
498
'replaceLimit ' => '1 '
499
- ),
499
+ ),
500
500
$ options
501
501
);
502
502
$ this ->prefixes = $ options ['prefixes ' ];
Original file line number Diff line number Diff line change @@ -573,55 +573,4 @@ public function testReplace()
573
573
$ this ->assertEquals ('/foo/mg ' , $ regex ->getRegex ());
574
574
$ this ->assertEquals ('bazbarbaz ' , $ regex ->replace ('foobarfoo ' , 'baz ' ));
575
575
}
576
-
577
-
578
- public function testPsr2 ()
579
- {
580
- $ pathToRoot = dirname (dirname (dirname (__DIR__ )));
581
- $ pathToVendor = $ pathToRoot . '/vendor ' ;
582
- $ pathToSrc = $ pathToRoot . '/src ' ;
583
- $ pathToTests = $ pathToRoot . '/tests ' ;
584
-
585
- if (
586
- !is_dir ($ pathToVendor )
587
- ) {
588
- $ this ->markTestSkipped ('Vendor directory not found. ' );
589
- return ;
590
- } elseif (
591
- !is_dir ($ pathToSrc )
592
- ) {
593
- $ this ->markTestSkipped ('Source directory not found. ' );
594
- return ;
595
- } elseif (
596
- !is_dir ($ pathToTests )
597
- ) {
598
- $ this ->markTestSkipped ('Tests directory not found. ' );
599
- return ;
600
- }
601
-
602
- foreach (array (
603
- $ pathToTests ,
604
- $ pathToSrc ,
605
- ) as $ dirToCheck ) {
606
- $ cmd = escapeshellcmd (
607
- 'php-cs-fixer fix --level=psr2 --dry-run ' . $ dirToCheck
608
- );
609
- exec ($ cmd , $ output , $ return_var );
610
- if ($ output ) {
611
- array_pop ($ output );
612
- $ output = array_map ('trim ' , $ output );
613
- }
614
-
615
- $ this ->assertEquals (
616
- 0 ,
617
- $ return_var ,
618
- (
619
- 'PSR-2 linter reported errors in ' .
620
- $ dirToCheck .
621
- '/: ' .
622
- implode ('; ' , $ output )
623
- )
624
- );
625
- }
626
- }
627
576
}
You can’t perform that action at this time.
0 commit comments