Skip to content

Commit 0c22522

Browse files
committed
build: Align tooling with the ecosystem assets and raise dependency floors.
1 parent f35ea29 commit 0c22522

5 files changed

Lines changed: 109 additions & 15 deletions

File tree

.gitattributes

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,18 @@
22

33
*.php text diff=php
44

5+
# Keep Claude tooling scripts out of GitHub's language statistics
6+
57
# Dev-only, excluded from the Packagist tarball
68
/.github export-ignore
79
/tests export-ignore
8-
/.claude export-ignore
910
/.editorconfig export-ignore
1011
/.gitattributes export-ignore
1112
/.gitignore export-ignore
13+
/phpcs.xml export-ignore
1214
/phpunit.xml export-ignore
13-
/phpunit.xml.dist export-ignore
14-
/phpstan.neon export-ignore
1515
/phpstan.neon.dist export-ignore
16-
/phpcs.xml export-ignore
17-
/phpcs.xml.dist export-ignore
18-
/infection.json export-ignore
1916
/infection.json.dist export-ignore
2017
/Makefile export-ignore
21-
/CONTRIBUTING.md export-ignore
22-
/CHANGES.md export-ignore
2318
/reports export-ignore
2419
/.phpunit.cache export-ignore

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
/vendor/
33
composer.lock
44

5+
# Local config overrides (committed baselines are the .dist files)
6+
/phpstan.neon
7+
/infection.json
8+
59
# Tooling cache
6-
.phpcs-cache
710
.phpunit.cache/
8-
.php-cs-fixer.cache
911
.phpunit.result.cache
12+
__pycache__/
13+
*.pyc
1014

1115
# Coverage and reports
1216
build/
@@ -18,6 +22,7 @@ infection.log
1822
.idea/
1923
.cursor/
2024
.vscode/
25+
/.claude/settings.local.json
2126

2227
# OS
2328
Thumbs.db

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ ifeq ($(ARCH),arm64)
66
PLATFORM := --platform=linux/amd64
77
endif
88

9-
DOCKER_RUN = docker run ${PLATFORM} --rm -it --net=host -v ${PWD}:/app -w /app gustavofreze/php:8.5-alpine
9+
TTY := $(shell [ -t 0 ] && echo -it)
10+
11+
DOCKER_RUN = docker run ${PLATFORM} --rm ${TTY} --net=host -v ${PWD}:/app -w /app gustavofreze/php:8.5-alpine
1012

1113
RESET := \033[0m
1214
GREEN := \033[0;32m

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
},
2929
"require-dev": {
3030
"ergebnis/composer-normalize": "^2.52",
31-
"infection/infection": "^0.33",
32-
"phpstan/phpstan": "^2.1",
33-
"phpunit/phpunit": "^13.1",
31+
"infection/infection": "^0.34",
32+
"phpstan/phpstan": "^2.2",
33+
"phpunit/phpunit": "^13.2",
34+
"slevomat/coding-standard": "^8.31",
3435
"squizlabs/php_codesniffer": "^4.0"
3536
},
3637
"minimum-stability": "stable",
@@ -47,6 +48,7 @@
4748
},
4849
"config": {
4950
"allow-plugins": {
51+
"dealerdirect/phpcodesniffer-composer-installer": true,
5052
"ergebnis/composer-normalize": true,
5153
"infection/extension-installer": true
5254
},

phpcs.xml

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,97 @@
11
<?xml version="1.0"?>
22
<ruleset name="tiny-blocks">
33
<description>Code style for the tiny-blocks library.</description>
4-
<rule ref="PSR12"/>
4+
55
<file>src</file>
66
<file>tests</file>
7+
8+
<rule ref="PSR12"/>
9+
10+
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
11+
<rule ref="Squiz.ControlStructures.ControlSignature"/>
12+
<rule ref="Squiz.ControlStructures.ElseIfDeclaration"/>
13+
<rule ref="Squiz.Formatting.OperatorBracket"/>
14+
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
15+
<properties>
16+
<property name="equalsSpacing" value="1"/>
17+
</properties>
18+
</rule>
19+
<rule ref="Squiz.Scope.MethodScope"/>
20+
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>
21+
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
22+
<properties>
23+
<property name="spacing" value="1"/>
24+
<property name="spacingBeforeFirst" value="0"/>
25+
<property name="spacingAfterLast" value="0"/>
26+
</properties>
27+
</rule>
28+
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
29+
30+
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
31+
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
32+
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
33+
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
34+
<rule ref="Generic.Metrics.CyclomaticComplexity">
35+
<properties>
36+
<property name="complexity" value="10"/>
37+
<property name="absoluteComplexity" value="20"/>
38+
</properties>
39+
</rule>
40+
<rule ref="Generic.Metrics.NestingLevel"/>
41+
<rule ref="Generic.NamingConventions.ConstructorName"/>
42+
<rule ref="Generic.PHP.DeprecatedFunctions"/>
43+
<rule ref="Generic.PHP.LowerCaseKeyword"/>
44+
<rule ref="Generic.Strings.UnnecessaryStringConcat">
45+
<properties>
46+
<property name="allowMultiline" value="true"/>
47+
</properties>
48+
</rule>
49+
50+
<rule ref="PSR2.Classes.PropertyDeclaration"/>
51+
<rule ref="PSR2.Files.EndFileNewline"/>
52+
<rule ref="PSR2.Methods.MethodDeclaration"/>
53+
54+
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
55+
<properties>
56+
<property name="groups" type="array">
57+
<element value="uses"/>
58+
<element value="public constants"/>
59+
<element value="protected constants"/>
60+
<element value="private constants"/>
61+
<element value="enum cases"/>
62+
<element value="public properties, public static properties"/>
63+
<element value="protected properties, protected static properties"/>
64+
<element value="private properties, private static properties"/>
65+
<element value="constructor, destructor"/>
66+
<element value="all public methods, all protected methods, all private methods, static constructors"/>
67+
<element value="magic methods"/>
68+
</property>
69+
</properties>
70+
</rule>
71+
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
72+
<rule ref="SlevomatCodingStandard.Complexity.Cognitive"/>
73+
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
74+
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
75+
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
76+
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
77+
<properties>
78+
<property name="searchAnnotations" value="true"/>
79+
</properties>
80+
</rule>
81+
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
82+
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
83+
<properties>
84+
<property name="spacesCountAroundEqualsSign" value="0"/>
85+
</properties>
86+
</rule>
87+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
88+
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"/>
89+
</rule>
90+
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
91+
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification"/>
92+
</rule>
93+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
94+
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/>
95+
</rule>
96+
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/>
797
</ruleset>

0 commit comments

Comments
 (0)