Skip to content

Commit 091371e

Browse files
committed
Apply compatibility patch before running PHPCS against our own code
1 parent 95ff26c commit 091371e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ before_install:
2424
install: travis_retry composer update --prefer-dist
2525

2626
script:
27-
- vendor/bin/phpcs
27+
- make phpcs
2828
- vendor/bin/phpunit
2929
- make test-report
3030

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
.PHONY: test test-report test-fix update-compatibility-patch
1+
.PHONY: test phpcs test-report test-fix update-compatibility-patch
22

33
PHP_74_OR_NEWER=`php -r "echo (int) version_compare(PHP_VERSION, '7.4', '>=');"`
44

55
test: test-report test-fix
66

7+
phpcs:
8+
@if [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply tests/php-compatibility.patch; fi
9+
@vendor/bin/phpcs src
10+
@if [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply -R tests/php-compatibility.patch; fi
11+
712
test-report: vendor
813
@if [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply tests/php-compatibility.patch; fi
914
@vendor/bin/phpcs `find tests/input/* | sort` --report=summary --report-file=phpcs.log; diff tests/expected_report.txt phpcs.log; if [ $$? -ne 0 ] && [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply -R tests/php-compatibility.patch; exit 1; fi

tests/php-compatibility.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/src/Unleashed/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php b/src/Unleashed/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php
2-
index 1905143..518a85b 100644
2+
index eee1c6f..742226e 100644
33
--- a/src/Unleashed/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php
44
+++ b/src/Unleashed/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php
55
@@ -11,11 +11,10 @@ use Unleashed\SniffHelper;

0 commit comments

Comments
 (0)