Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4d0a12e

Browse files
Merge pull request #21 from SignpostMarv/travis
Enabling continuous integration via Travis
2 parents b7caf16 + cd72b31 commit 4d0a12e

File tree

5 files changed

+25
-58
lines changed

5 files changed

+25
-58
lines changed

‎.travis.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
##PHPVerbalExpressions
1+
[![Build Status](https://travis-ci.org/VerbalExpressions/PHPVerbalExpressions.svg)](https://travis-ci.org/VerbalExpressions/PHPVerbalExpressions)
2+
3+
##PHPVerbalExpressions
24
- ported from [VerbalExpressions](https://github.com/VerbalExpressions/JSVerbalExpressions)
35

46
VerbalExpressions is a PHP library that helps to construct hard regular expressions.

‎composer.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
"type": "project",
55
"description": "PHP Regular expressions made easy",
66
"require": {
7+
"php": ">=5.3",
8+
"fabpot/php-cs-fixer": "^1.11"
79
},
810
"require-dev": {
9-
"phpunit/phpunit": "^5.1"
11+
"phpunit/phpunit": "* >=4"
1012
},
1113
"suggest": {
1214
"fabpot/php-cs-fixer": "PHP CS Fixer (testing for PSR-2 compliance)"

‎src/VerbalExpressions/PHPVerbalExpressions/VerbalExpressions.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,12 +491,12 @@ public function clean(array $options = array())
491491
{
492492
$options = array_merge(
493493
array(
494-
'prefixes' => '',
495-
'source' => '',
496-
'suffixes' => '',
497-
'modifiers' => 'gm',
494+
'prefixes' => '',
495+
'source' => '',
496+
'suffixes' => '',
497+
'modifiers' => 'gm',
498498
'replaceLimit' => '1'
499-
),
499+
),
500500
$options
501501
);
502502
$this->prefixes = $options['prefixes'];

‎tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php‎

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -573,55 +573,4 @@ public function testReplace()
573573
$this->assertEquals('/foo/mg', $regex->getRegex());
574574
$this->assertEquals('bazbarbaz', $regex->replace('foobarfoo', 'baz'));
575575
}
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-
}
627576
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /