Skip to content

Commit 2a018cc

Browse files
committed
Update build
1 parent ac4791e commit 2a018cc

File tree

7 files changed

+84
-46
lines changed

7 files changed

+84
-46
lines changed

.cs.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
'@Symfony' => true,
1111
'psr4' => true,
1212
// custom rules
13-
'align_multiline_comment' => true, // psr-5
13+
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // psr-5
14+
'phpdoc_to_comment' => false,
1415
'array_indentation' => true,
1516
'array_syntax' => ['syntax' => 'short'],
1617
'cast_spaces' => ['space' => 'none'],

.scrutinizer.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tools:
1313
build:
1414
environment:
1515
php: 7.2
16-
mysql: true
16+
mysql: false
1717
node: false
1818
postgresql: false
1919
mongodb: false
@@ -22,14 +22,19 @@ build:
2222
memcached: false
2323
neo4j: false
2424
rabbitmq: false
25+
nodes:
26+
analysis:
27+
tests:
28+
override:
29+
- php-scrutinizer-run
2530
dependencies:
26-
before:
27-
- composer self-update
28-
- composer update --no-interaction --prefer-dist
31+
before:
32+
- composer self-update
33+
- composer update --no-interaction --prefer-dist --no-progress
2934
tests:
3035
before:
3136
-
32-
command: 'vendor/bin/phpunit --coverage-clover build/logs/clover.xml'
37+
command: composer test-coverage
3338
coverage:
3439
file: 'build/logs/clover.xml'
3540
format: 'clover'

.travis.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
language: php
22

33
php:
4-
- 7.1
54
- 7.2
6-
7-
# This triggers builds to run on the new TravisCI infrastructure.
8-
# See: https://docs.travis-ci.com/user/getting-started/#Selecting-infrastructure-(optional)
9-
sudo: false
5+
- 7.3
6+
7+
dist: bionic
108

11-
# Cache composer
129
cache:
1310
directories:
1411
- $HOME/.composer/cache
1512

1613
before_script:
17-
- travis_retry composer self-update
18-
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist
14+
- composer self-update
15+
- composer install --no-interaction --prefer-dist --no-progress
1916
- cd $TRAVIS_BUILD_DIR
2017

2118
script:
22-
# - composer check-style
23-
- composer phpstan
24-
- composer test-coverage
19+
- composer check-all

_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

build.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

composer.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,27 @@
1111
"php": ">=7.1"
1212
},
1313
"require-dev": {
14+
"overtrue/phplint": "^1.1",
15+
"phpstan/phpstan-shim": "^0.11",
1416
"phpunit/phpunit": "^7.0",
15-
"phpstan/phpstan-shim": "^0.11"
17+
"squizlabs/php_codesniffer": "^3.4"
1618
},
1719
"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 --no-progress"
20+
"test": "phpunit --configuration phpunit.xml",
21+
"test-coverage": "phpunit --configuration phpunit.xml --coverage-clover build/logs/clover.xml --coverage-html build/coverage",
22+
"check-style": "phpcs --standard=phpcs.xml",
23+
"fix-style": "phpcbf --standard=phpcs.xml",
24+
"phpstan": "phpstan analyse src tests --level=max -c phpstan.neon --no-progress",
25+
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
26+
"install-cs": "php -r \"@mkdir('build'); copy('https://cs.symfony.com/download/php-cs-fixer-v2.phar', 'build/php-cs-fixer-v2.phar');\"",
27+
"fix-cs": "php build/php-cs-fixer-v2.phar fix --config=.cs.php",
28+
"check-cs": "php build/php-cs-fixer-v2.phar fix --dry-run --format=txt --verbose --diff --diff-format=udiff --config=.cs.php",
29+
"check-all": [
30+
"@lint",
31+
"@check-style",
32+
"@phpstan",
33+
"@test-coverage"
34+
]
2335
},
2436
"autoload": {
2537
"psr-4": {

phpcs.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Coding Standard">
3+
<arg name="basepath" value="."/>
4+
<arg name="colors"/>
5+
<arg value="sp"/>
6+
7+
<config name="ignore_warnings_on_exit" value="1"/>
8+
9+
<file>./src</file>
10+
<file>./tests</file>
11+
12+
<rule ref="PSR2"></rule>
13+
<!-- <rule ref="PSR12"></rule> -->
14+
15+
<rule ref="Squiz.Commenting.ClassComment">
16+
<exclude name="Squiz.Commenting.ClassComment.TagNotAllowed"/>
17+
<type>warning</type>
18+
<exclude-pattern>*/tests/</exclude-pattern>
19+
</rule>
20+
<rule ref="Squiz.Commenting.ClassComment.Missing">
21+
<type>warning</type>
22+
</rule>
23+
<rule ref="Squiz.Commenting.FunctionComment.Missing">
24+
<type>warning</type>
25+
<exclude-pattern>*/config/</exclude-pattern>
26+
</rule>
27+
<rule ref="Squiz.Commenting.FunctionComment.MissingParamTag">
28+
<type>warning</type>
29+
</rule>
30+
<rule ref="Squiz.Commenting.FunctionComment.MissingParamComment">
31+
<type>warning</type>
32+
</rule>
33+
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentNotCapital">
34+
<type>warning</type>
35+
</rule>
36+
37+
<rule ref="Generic.Metrics.CyclomaticComplexity">
38+
<properties>
39+
<property name="absoluteComplexity" value="50"/>
40+
</properties>
41+
</rule>
42+
<rule ref="Generic.Metrics.NestingLevel">
43+
<properties>
44+
<property name="nestingLevel" value="2"/>
45+
<property name="absoluteNestingLevel" value="4"/>
46+
</properties>
47+
</rule>
48+
</ruleset>

0 commit comments

Comments
 (0)