Skip to content

Commit cd7ac8a

Browse files
committed
Config: use PHP 8.2 base, align with Contributte standard
1 parent 9dd6603 commit cd7ac8a

File tree

6 files changed

+54
-34
lines changed

6 files changed

+54
-34
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ indent_style = tab
1111
indent_size = tab
1212
tab_width = 4
1313

14-
[{*.json, *.yaml, *.yml, *.md}]
14+
[*.{json,yaml,yml,md}]
1515
indent_style = space
1616
indent_size = 2

.gitattributes

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# Not archived
21
.docs export-ignore
3-
tests export-ignore
42
.editorconfig export-ignore
53
.gitattributes export-ignore
64
.gitignore export-ignore
75
.travis.yml export-ignore
8-
phpstan.neon export-ignore
96
Makefile export-ignore
107
README.md export-ignore
8+
phpstan.neon export-ignore
119
ruleset.xml export-ignore
10+
tests export-ignore

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
/composer.lock
77

88
# Tests
9-
/temp
10-
/tests/php-unix.generated.ini
11-
/coverage.xml
12-
/php-coveralls.phar
9+
/tests/tmp
10+
/coverage.*
11+
/tests/**/*.log
12+
/tests/**/*.html
13+
/tests/**/*.expected
14+
/tests/**/*.actual

Makefile

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
.PHONY: install qa cs csf phpstan tests coverage-clover coverage-html
2-
1+
.PHONY: install
32
install:
4-
composer install
3+
composer update
54

5+
.PHONY: qa
66
qa: phpstan cs
77

8+
.PHONY: cs
89
cs:
9-
vendor/bin/phpcs --standard=ruleset.xml --extensions=php,phpt --tab-width=4 --ignore=temp -sp src tests
10+
ifdef GITHUB_ACTION
11+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp -q --report=checkstyle src tests | cs2pr
12+
else
13+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests
14+
endif
1015

16+
.PHONY: csf
1117
csf:
12-
vendor/bin/phpcbf --standard=ruleset.xml --extensions=php,phpt --tab-width=4 --ignore=temp -sp src tests
18+
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests
1319

20+
.PHONY: phpstan
1421
phpstan:
15-
vendor/bin/phpstan analyse -l 1 -c phpstan.neon --memory-limit=512M src
22+
vendor/bin/phpstan analyse -c phpstan.neon
1623

24+
.PHONY: tests
1725
tests:
18-
vendor/bin/tester -s -p php --colors 1 -C tests
19-
20-
coverage-clover:
21-
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src ./tests
22-
23-
coverage-html:
24-
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.html --coverage-src ./src ./tests
26+
vendor/bin/tester -s -p php --colors 1 -C tests/Cases
27+
28+
.PHONY: coverage
29+
coverage:
30+
ifdef GITHUB_ACTION
31+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases
32+
else
33+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases
34+
endif

phpstan.neon

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1+
includes:
2+
- vendor/contributte/phpstan/phpstan.neon
3+
14
parameters:
5+
level: 1
6+
phpVersion: 80200
7+
8+
scanDirectories:
9+
- src
10+
11+
fileExtensions:
12+
- php
13+
14+
paths:
15+
- src
16+
217
ignoreErrors:
318
- # hack for debugger
419
message: '~^Variable property access on \$this\(Contributte\\ThePay\\Payment\)\.$~'

ruleset.xml

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

6-
<!-- Specific rules -->
6+
<!-- Rules -->
77
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
88
<properties>
99
<property name="rootNamespaces" type="array">
1010
<element key="src" value="Contributte\ThePay"/>
11-
<element key="tests/cases" value="Tests"/>
12-
<element key="tests/fixtures" value="Tests"/>
11+
<element key="tests" value="Tests"/>
1312
</property>
14-
<property name="extensions" type="array" value="php,phpt"/>
1513
</properties>
1614
</rule>
1715

18-
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
19-
<exclude-pattern>tests/cases/*</exclude-pattern>
20-
</rule>
21-
22-
<!--Exclude folders -->
16+
<!-- Excludes -->
2317
<exclude-pattern>/tests/tmp</exclude-pattern>
2418
</ruleset>

0 commit comments

Comments
 (0)