Skip to content

Commit 7c0a23b

Browse files
committed
Raised the QA level
1 parent 0adcba2 commit 7c0a23b

16 files changed

+2548
-3562
lines changed

.dependabot/config.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 1
2+
update_configs:
3+
- package_manager: "php:composer"
4+
directory: "/"
5+
update_schedule: "live"
6+
default_labels:
7+
- "Dependencies 📦"
8+
- "PHP 🐘"
9+
version_requirement_updates: "widen_ranges"
10+
automerged_updates:
11+
- match:
12+
dependency_type: "all"
13+
update_type: "semver:minor"
14+
- match:
15+
dependency_type: "all"
16+
update_type: "semver:patch"

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: WyriHaximus

.github/workflows/ci.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Continuous Integration
2+
on:
3+
push:
4+
pull_request:
5+
jobs:
6+
composer-install:
7+
strategy:
8+
matrix:
9+
php: [7.4]
10+
composer: [lowest, current, highest]
11+
runs-on: ubuntu-latest
12+
container:
13+
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.11-dev-root
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Cache composer packages
17+
uses: actions/cache@v1
18+
with:
19+
path: ./vendor/
20+
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
21+
- name: Install Dependencies
22+
run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o
23+
if: matrix.composer == 'lowest'
24+
- name: Install Dependencies
25+
run: composer install --ansi --no-progress --no-interaction --prefer-dist -o
26+
if: matrix.composer == 'current'
27+
- name: Install Dependencies
28+
run: composer update --ansi --no-progress --no-interaction --prefer-dist -o
29+
if: matrix.composer == 'highest'
30+
qa:
31+
strategy:
32+
matrix:
33+
php: [7.4]
34+
composer: [lowest, current, highest]
35+
qa: [lint, cs, stan, psalm, unit-ci, infection, composer-require-checker, composer-unused]
36+
needs: composer-install
37+
runs-on: ubuntu-latest
38+
container:
39+
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.11-dev-root
40+
steps:
41+
- uses: actions/checkout@v1
42+
- name: Cache composer packages
43+
uses: actions/cache@v1
44+
with:
45+
path: ./vendor/
46+
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
47+
- name: Install Dependencies
48+
run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o
49+
if: matrix.composer == 'lowest'
50+
- name: Install Dependencies
51+
run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o
52+
if: matrix.composer == 'current'
53+
- name: Install Dependencies
54+
run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o
55+
if: matrix.composer == 'highest'
56+
- run: make ${{ matrix.qa }}

.php_cs

-21
This file was deleted.

.scrutinizer.yml

+10-66
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,12 @@
11
filter:
22
paths: [src/*]
3-
excluded_paths: [examples/*, tests/*]
4-
tools:
5-
external_code_coverage: true
6-
php_analyzer: true
7-
php_hhvm: true
8-
php_sim: true
9-
php_pdepend: true
10-
sensiolabs_security_checker: true
11-
php_changetracking: true
12-
php_code_sniffer:
13-
enabled: true
14-
config:
15-
tab_width: 0
16-
encoding: utf8
17-
ruleset: ~
18-
standard: "PSR2"
19-
php_cs_fixer:
20-
enabled: true
21-
config:
22-
level: psr2
23-
php_mess_detector:
24-
enabled: true
25-
config:
26-
ruleset: ~
27-
code_size_rules:
28-
cyclomatic_complexity: true
29-
npath_complexity: true
30-
excessive_method_length: true
31-
excessive_class_length: true
32-
excessive_parameter_list: true
33-
excessive_public_count: true
34-
too_many_fields: true
35-
too_many_methods: true
36-
excessive_class_complexity: true
37-
design_rules:
38-
exit_expression: true
39-
eval_expression: true
40-
goto_statement: true
41-
number_of_class_children: true
42-
depth_of_inheritance: true
43-
coupling_between_objects: true
44-
unused_code_rules:
45-
unused_private_field: true
46-
unused_local_variable: true
47-
unused_private_method: true
48-
unused_formal_parameter: true
49-
naming_rules:
50-
short_variable:
51-
minimum: 3
52-
long_variable:
53-
maximum: 20
54-
short_method:
55-
minimum: 3
56-
constructor_conflict: true
57-
constant_naming: true
58-
boolean_method_name: true
59-
controversial_rules:
60-
superglobals: true
61-
camel_case_class_name: true
62-
camel_case_property_name: true
63-
camel_case_method_name: true
64-
camel_case_parameter_name: true
65-
camel_case_variable_name: true
66-
checks:
67-
php:
68-
code_rating: true
3+
excluded_paths: [tests/*]
4+
build:
5+
nodes:
6+
analysis:
7+
environment:
8+
php:
9+
version: 7.4
10+
tests:
11+
override:
12+
- php-scrutinizer-run --enable-security-analysis

.travis.yml

-72
This file was deleted.

Makefile

+33-20
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
1-
all:
2-
composer run-script qa-all --timeout=0
1+
# set all to phony
2+
SHELL=bash
33

4-
all-coverage:
5-
composer run-script qa-all-coverage --timeout=0
4+
.PHONY: *
65

7-
ci:
8-
composer run-script qa-ci --timeout=0
6+
ifneq ("$(wildcard /.dockerenv)","")
7+
DOCKER_RUN=
8+
else
9+
DOCKER_RUN=docker run --rm -it \
10+
-v `pwd`:`pwd` \
11+
-w `pwd` \
12+
"wyrihaximusnet/php:7.4-zts-alpine3.11-dev"
13+
endif
914

10-
ci-extended:
11-
composer run-script qa-ci-extended --timeout=0
15+
all: lint cs-fix cs stan psalm unit infection composer-require-checker composer-unused
1216

13-
contrib:
14-
composer run-script qa-contrib --timeout=0
15-
16-
init:
17-
composer ensure-installed
17+
lint:
18+
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
1819

1920
cs:
20-
composer cs
21+
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(nproc)
2122

2223
cs-fix:
23-
composer cs-fix
24+
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(nproc)
25+
26+
stan:
27+
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c phpstan.neon
28+
29+
psalm:
30+
$(DOCKER_RUN) vendor/bin/psalm --threads=$(nproc) --shepherd --stats
2431

2532
unit:
26-
composer run-script unit --timeout=0
33+
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml
34+
35+
unit-ci: unit
36+
if [ -f ./build/logs/clover.xml ]; then wget https://scrutinizer-ci.com/ocular.phar && sleep 3 && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi
37+
38+
infection:
39+
$(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(nproc)
2740

28-
unit-coverage:
29-
composer run-script unit-coverage --timeout=0
41+
composer-require-checker:
42+
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=composer-require-checker.json
3043

31-
ci-coverage: init
32-
composer ci-coverage
44+
composer-unused:
45+
$(DOCKER_RUN) composer unused --ansi

composer-require-checker.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"symbol-whitelist" : [
3+
"null", "true", "false",
4+
"static", "self", "parent",
5+
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object"
6+
],
7+
"php-core-extensions" : [
8+
"Core",
9+
"date",
10+
"pcre",
11+
"Phar",
12+
"Reflection",
13+
"SPL",
14+
"standard"
15+
],
16+
"scan-files" : []
17+
}

0 commit comments

Comments
 (0)