Skip to content

Commit a09f2ba

Browse files
committed
Update build
1 parent c4cc70b commit a09f2ba

File tree

4 files changed

+37
-84
lines changed

4 files changed

+37
-84
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ before_script:
1919
- cd $TRAVIS_BUILD_DIR
2020

2121
script:
22-
- ant check-style
23-
- ant phpstan
24-
- ant phpunit-coverage
22+
# - composer check-style
23+
- composer phpstan
24+
- composer phpunit-coverage

build.xml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project name="app" basedir=".">
33

4-
<condition property="ext" value=".bat">
5-
<os family="windows"/>
6-
</condition>
7-
8-
<condition property="ext" value=".bat" else="">
9-
<os family="windows"/>
10-
</condition>
11-
12-
<target name="phpunit" description="Run PHPUnit">
13-
<exec executable="${basedir}/vendor/bin/phpunit${ext}" searchpath="true" resolveexecutable="true" failonerror="true" taskname="phpunit">
14-
<arg value="--configuration"/>
15-
<arg path="${basedir}/phpunit.xml"/>
16-
</exec>
17-
</target>
18-
19-
<target name="phpunit-coverage" description="Run unit tests with PHPUnit with coverage">
20-
<delete dir="${basedir}/build/coverage"/>
21-
<mkdir dir="${basedir}/build/coverage"/>
22-
<exec executable="${basedir}/vendor/bin/phpunit${ext}" searchpath="true" resolveexecutable="true"
23-
failonerror="true" taskname="phpunit-coverage">
24-
<arg value="--coverage-text"/>
25-
<arg value="--configuration"/>
26-
<arg path="${basedir}/phpunit.xml"/>
27-
<arg value="--coverage-clover"/>
28-
<arg path="${basedir}/build/logs/clover.xml"/>
29-
<arg value="--coverage-html"/>
30-
<arg path="${basedir}/build/coverage"/>
31-
</exec>
32-
</target>
33-
344
<target name="fix-style" description="Code style fixer">
355
<mkdir dir="${basedir}/build"/>
366
<get src="http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar" dest="${basedir}/build/php-cs-fixer.phar" skipexisting="true"/>
@@ -49,22 +19,4 @@
4919
</exec>
5020
</target>
5121

52-
<target name="phpstan" description="PHP Static Analysis Tool - discover bugs in your code without running it">
53-
<mkdir dir="${basedir}/build"/>
54-
<get src="https://github.com/phpstan/phpstan/releases/download/0.9.2/phpstan.phar"
55-
dest="${basedir}/build/phpstan.phar" skipexisting="true"/>
56-
<exec executable="php" searchpath="true" resolveexecutable="true" failonerror="true">
57-
<arg value="${basedir}/build/phpstan.phar"/>
58-
<arg value="analyse"/>
59-
<arg value="-l"/>
60-
<arg value="5"/>
61-
<arg value="src"/>
62-
<arg value="tests"/>
63-
<arg value="--no-interaction"/>
64-
<arg value="--no-progress"/>
65-
</exec>
66-
</target>
67-
68-
<target name="check-travis" depends="check-style,phpstan"/>
69-
7022
</project>

composer.json

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
{
2-
"name": "odan/validation",
3-
"description": "Validation classes",
4-
"minimum-stability": "stable",
5-
"type": "library",
6-
"keywords": [
7-
"validation"
8-
],
9-
"license": "MIT",
10-
"authors": [
11-
{
12-
"name": "Odan",
13-
"homepage": "https://odan.github.io/",
14-
"role": "Developer"
2+
"name": "odan/validation",
3+
"description": "Validation classes",
4+
"minimum-stability": "stable",
5+
"type": "library",
6+
"keywords": [
7+
"validation"
8+
],
9+
"license": "MIT",
10+
"require": {
11+
"php": ">=7.1"
12+
},
13+
"require-dev": {
14+
"phpunit/phpunit": "^6.0|^7.0",
15+
"phpstan/phpstan-shim": "^0.11"
16+
},
17+
"scripts": {
18+
"test": "php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml",
19+
"test-coverage": "php vendor/phpunit/phpunit/phpunit --coverage-text --configuration phpunit.xml --coverage-clover build/logs/clover.xml --coverage-html build/coverage",
20+
"check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",
21+
"fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit -n src tests",
22+
"phpstan": "php vendor/phpstan/phpstan-shim/phpstan analyse src tests --level=max -c phpstan.neon"
23+
},
24+
"autoload": {
25+
"psr-4": {
26+
"Odan\\Validation\\": "src/Validation/"
27+
}
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"Odan\\Validation\\Test\\": "tests/"
32+
}
33+
},
34+
"config": {
35+
"sort-packages": true
1536
}
16-
],
17-
"require": {
18-
"php": ">=7.1"
19-
},
20-
"require-dev": {
21-
"phpunit/phpunit": "^6.0|^7.0"
22-
},
23-
"autoload": {
24-
"psr-4": {
25-
"Odan\\Validation\\": "src/Validation/"
26-
}
27-
},
28-
"autoload-dev": {
29-
"psr-4": {
30-
"Odan\\Validation\\Test\\": "tests/"
31-
}
32-
},
33-
"config": {
34-
"sort-packages": true
35-
}
3637
}

phpstan.neon

Whitespace-only changes.

0 commit comments

Comments
 (0)