Skip to content

Commit 55c8fc2

Browse files
authored
name-collision-detector (#63)
1 parent fe4244e commit 55c8fc2

5 files changed

Lines changed: 35 additions & 1 deletion

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Makefile export-ignore
99
phpstan.neon export-ignore
1010
CLAUDE.md export-ignore
1111
phpunit.xml export-ignore
12+
collision-detector.json export-ignore

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,29 @@ jobs:
185185

186186
- name: "PHPStan"
187187
run: "make phpstan"
188+
189+
name-collision:
190+
name: "Name Collision Detector"
191+
192+
runs-on: "ubuntu-latest"
193+
timeout-minutes: 60
194+
195+
steps:
196+
- name: Harden the runner (Audit all outbound calls)
197+
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
198+
with:
199+
egress-policy: audit
200+
201+
- name: "Checkout"
202+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
203+
204+
- name: "Install PHP"
205+
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
206+
with:
207+
coverage: "none"
208+
php-version: "8.5"
209+
210+
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
211+
212+
- name: "Name Collision Detector"
213+
run: "make name-collision"

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ cs-fix:
2727
.PHONY: phpstan
2828
phpstan:
2929
php vendor/bin/phpstan analyse -l 8 -c phpstan.neon src tests
30+
31+
name-collision:
32+
php vendor/bin/detect-collisions --configuration collision-detector.json

collision-detector.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"scanPaths": ["src", "tests"]
3+
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"php-parallel-lint/php-parallel-lint": "^1.2",
1818
"phpstan/phpstan-phpunit": "^2.0",
1919
"phpstan/phpstan-strict-rules": "^2.0",
20-
"phpunit/phpunit": "^9.6"
20+
"phpunit/phpunit": "^9.6",
21+
"shipmonk/name-collision-detector": "^2.1"
2122
},
2223
"config": {
2324
"platform": {

0 commit comments

Comments
 (0)