Added, and configured, php-cs-fixer with a Makefile to invoke fix and test
This commit is contained in:
14
.php_cs
Normal file
14
.php_cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$finder = PhpCsFixer\Finder::create()
|
||||||
|
->in(__DIR__ . '/src')
|
||||||
|
->in(__DIR__ . '/tests')
|
||||||
|
;
|
||||||
|
|
||||||
|
return PhpCsFixer\Config::create()
|
||||||
|
->setUsingCache(false)
|
||||||
|
->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
])
|
||||||
|
->setFinder($finder)
|
||||||
|
;
|
||||||
@@ -10,5 +10,8 @@ before_install:
|
|||||||
install:
|
install:
|
||||||
- travis_retry composer install --no-interaction --prefer-source
|
- travis_retry composer install --no-interaction --prefer-source
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- php -v
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- composer test
|
- make all
|
||||||
|
|||||||
12
Makefile
Normal file
12
Makefile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
THIS := $(realpath $(lastword $(MAKEFILE_LIST)))
|
||||||
|
HERE := $(shell dirname $(THIS))
|
||||||
|
|
||||||
|
.PHONY: all fix test
|
||||||
|
|
||||||
|
all: fix test
|
||||||
|
|
||||||
|
fix:
|
||||||
|
php $(HERE)/vendor/bin/php-cs-fixer fix --config=$(HERE)/.php_cs
|
||||||
|
|
||||||
|
test:
|
||||||
|
php $(HERE)/vendor/bin/phpunit --configuration $(HERE)/phpunit.xml
|
||||||
@@ -5,7 +5,8 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"guzzlehttp/guzzle": "^6.2.2",
|
"guzzlehttp/guzzle": "^6.2.2",
|
||||||
"php": ">=7.0.0",
|
"php": ">=7.0.0",
|
||||||
"psr/http-message": "~1.0"
|
"psr/http-message": "~1.0",
|
||||||
|
"friendsofphp/php-cs-fixer": "^2.6"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "5.7.5",
|
"phpunit/phpunit": "5.7.5",
|
||||||
@@ -22,8 +23,5 @@
|
|||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Cloudflare\\API\\": "src/"
|
"Cloudflare\\API\\": "src/"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"test": "phpunit"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user