Skip to content

Commit 27e550e

Browse files
claudef3l1x
authored andcommitted
QA: update phpstan, ruleset and Makefile
1 parent a6333aa commit 27e550e

File tree

3 files changed

+38
-23
lines changed

3 files changed

+38
-23
lines changed

Makefile

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
.PHONY: install qa cs csf phpstan tests coverage-clover coverage-html
1+
.PHONY: install qa cs csf phpstan tests coverage
22

33
install:
44
composer update
55

66
qa: phpstan cs
77

88
cs:
9-
vendor/bin/codesniffer src tests
9+
ifdef GITHUB_ACTION
10+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 -q --report=checkstyle src tests | cs2pr
11+
else
12+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 -nsp src tests
13+
endif
1014

1115
csf:
12-
vendor/bin/codefixer src tests
16+
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 -nsp src tests
1317

1418
phpstan:
15-
vendor/bin/phpstan analyse -l 8 -c phpstan.neon src
19+
vendor/bin/phpstan analyse -c phpstan.neon
1620

1721
tests:
18-
vendor/bin/tester -s -p php --colors 1 -C tests/cases
19-
20-
coverage-clover:
21-
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases
22-
23-
coverage-html:
24-
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.html --coverage-src ./src tests/cases
22+
vendor/bin/tester -s -p php --colors 1 -C tests/Cases
23+
24+
coverage:
25+
ifdef GITHUB_ACTION
26+
vendor/bin/tester -s -p php --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/Cases
27+
else
28+
vendor/bin/tester -s -p php --colors 1 -C --coverage ./coverage.html --coverage-src ./src tests/Cases
29+
endif

phpstan.neon

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
includes:
2-
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
3-
- vendor/phpstan/phpstan-nette/extension.neon
4-
- vendor/phpstan/phpstan-nette/rules.neon
5-
- vendor/phpstan/phpstan-strict-rules/rules.neon
2+
- vendor/contributte/phpstan/phpstan.neon
3+
4+
parameters:
5+
level: 9
6+
phpVersion: 80200
7+
8+
scanDirectories:
9+
- src
10+
11+
fileExtensions:
12+
- php
13+
14+
paths:
15+
- src
16+
- .docs

ruleset.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<?xml version="1.0"?>
2-
<ruleset>
2+
<ruleset name="Contributte" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
33
<!-- Contributte Coding Standard -->
4-
<rule ref="./vendor/ninjify/coding-standard/contributte.xml"/>
4+
<rule ref="./vendor/contributte/qa/ruleset-8.2.xml"/>
55

66
<!-- Specific rules -->
77
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
88
<properties>
9-
<property name="rootNamespaces" type="array" value="
10-
src=>Contributte\Security,
11-
tests=>Tests\Contributte\Security
12-
"/>
9+
<property name="rootNamespaces" type="array">
10+
<element key="src" value="Contributte\Security"/>
11+
<element key="tests" value="Tests"/>
12+
</property>
1313
</properties>
1414
</rule>
1515

16-
<!--Exclude folders -->
16+
<!-- Exclude folders -->
1717
<exclude-pattern>/tests/tmp</exclude-pattern>
1818
</ruleset>
19-

0 commit comments

Comments
 (0)