Skip to content

Commit f6e9109

Browse files
committed
Maintenance: editorconfig, gitignore, phpstan, codesniffer, makefile
1 parent 1a52390 commit f6e9109

File tree

6 files changed

+30
-64
lines changed

6 files changed

+30
-64
lines changed

Diff for: .editorconfig

+1-1
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

Diff for: .gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ tests export-ignore
77
.travis.yml export-ignore
88
Makefile export-ignore
99
phpstan.neon export-ignore
10-
phpstan.php export-ignore
1110
README.md export-ignore
1211
ruleset.xml export-ignore

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
/composer.lock
77

88
# Tests
9-
/temp
109
/coverage.xml

Diff for: Makefile

+10-15
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
1-
.PHONY: install qa cs csf phpstan tests coverage
2-
1+
.PHONY: install
32
install:
43
composer update
54

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

8+
.PHONY: cs
89
cs:
910
ifdef GITHUB_ACTION
10-
vendor/bin/codesniffer -q --report=checkstyle src tests | cs2pr
11+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp -q --report=checkstyle src tests | cs2pr
1112
else
12-
vendor/bin/codesniffer src tests
13+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests
1314
endif
1415

16+
.PHONY: csf
1517
csf:
16-
vendor/bin/codefixer src tests
18+
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests
1719

20+
.PHONY: phpstan
1821
phpstan:
1922
vendor/bin/phpstan analyse -c phpstan.neon
2023

24+
.PHONY: tests
2125
tests:
2226
vendor/bin/tester -s -p php --colors 1 -C tests/Cases
2327

28+
.PHONY: coverage
2429
coverage:
2530
ifdef GITHUB_ACTION
2631
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases
2732
else
2833
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases
2934
endif
30-
31-
# Docker
32-
.PHONY: redis-start redis-stop
33-
34-
redis-start: redis-stop
35-
docker run -it -d -p 6379:6379 --name contributte-redis redis:5-alpine
36-
37-
redis-stop:
38-
docker stop contributte-redis || true
39-
docker rm contributte-redis || true

Diff for: phpstan.neon

+12-38
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,23 @@
11
includes:
2-
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
3-
- vendor/phpstan/phpstan-nette/extension.neon
4-
- vendor/phpstan/phpstan-nette/rules.neon
2+
- vendor/contributte/phpstan/phpstan.neon
3+
- phpstan-baseline.neon
54

65
parameters:
7-
level: 8
6+
level: 9
7+
phpVersion: 80200
8+
9+
scanDirectories:
10+
- src
11+
12+
fileExtensions:
13+
- php
14+
- phpt
815

916
paths:
1017
- src
18+
- .docs
1119

1220
excludePaths:
1321
- src/DI/RedisExtension24.php
1422

1523
ignoreErrors:
16-
- "#^Do\\-while loop condition is always false\\.$#"
17-
18-
# backward compatibility with nette/caching < 3.1
19-
-
20-
message: """
21-
#^Class Contributte\\\\Redis\\\\Caching\\\\RedisJournal implements deprecated interface Nette\\\\Caching\\\\Storages\\\\IJournal\\:
22-
use Nette\\\\Caching\\\\Storages\\\\Journal$#
23-
"""
24-
count: 1
25-
path: src/Caching/RedisJournal.php
26-
27-
-
28-
message: """
29-
#^Class Contributte\\\\Redis\\\\Caching\\\\RedisStorage implements deprecated interface Nette\\\\Caching\\\\IStorage\\:
30-
use Nette\\\\Caching\\\\Storage$#
31-
"""
32-
count: 1
33-
path: src/Caching/RedisStorage.php
34-
35-
-
36-
message: """
37-
#^Parameter \\$journal of method Contributte\\\\Redis\\\\Caching\\\\RedisStorage\\:\\:__construct\\(\\) has typehint with deprecated interface Nette\\\\Caching\\\\Storages\\\\IJournal\\:
38-
use Nette\\\\Caching\\\\Storages\\\\Journal$#
39-
"""
40-
count: 1
41-
path: src/Caching/RedisStorage.php
42-
43-
-
44-
message: """
45-
#^Fetching class constant class of deprecated class Nette\\\\Caching\\\\IStorage\\:
46-
use Nette\\\\Caching\\\\Storage$#
47-
"""
48-
count: 3
49-
path: src/DI/RedisExtension.php

Diff for: ruleset.xml

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
<?xml version="1.0"?>
2-
<ruleset>
3-
<!-- Contributte Coding Standard -->
4-
<rule ref="./vendor/ninjify/coding-standard/contributte.xml">
5-
<exclude name="Squiz.Commenting.FunctionComment.InvalidTypeHint"/>
6-
<exclude name="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator.TernaryOperatorNotUsed"/>
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">
5+
<exclude name="SlevomatCodingStandard.PHP.DisallowReference.DisallowedPassingByReference"/>
76
</rule>
87

9-
<!-- Specific rules -->
8+
<!-- Rules -->
109
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
1110
<properties>
1211
<property name="rootNamespaces" type="array">
@@ -16,6 +15,6 @@
1615
</properties>
1716
</rule>
1817

19-
<!-- Exclude folders -->
18+
<!-- Excludes -->
2019
<exclude-pattern>/tests/tmp</exclude-pattern>
2120
</ruleset>

0 commit comments

Comments
 (0)