Skip to content

Commit 8af50e2

Browse files
authored
name-collision-detector (#745)
1 parent fb8f874 commit 8af50e2

4 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/lint-workflows.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,29 @@ jobs:
111111
sarif_file: results.sarif
112112
category: zizmor
113113
wait-for-processing: false
114+
115+
name-collision:
116+
name: "Name Collision Detector"
117+
118+
runs-on: "ubuntu-latest"
119+
timeout-minutes: 60
120+
121+
steps:
122+
- name: Harden the runner (Audit all outbound calls)
123+
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
124+
with:
125+
egress-policy: audit
126+
127+
- name: "Checkout"
128+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
129+
130+
- name: "Install PHP"
131+
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
132+
with:
133+
coverage: "none"
134+
php-version: "8.5"
135+
136+
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
137+
138+
- name: "Name Collision Detector"
139+
run: "make name-collision"

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ phpstan:
3232
.PHONY: phpstan-generate-baseline
3333
phpstan-generate-baseline:
3434
php vendor/bin/phpstan analyse -c phpstan.neon -b phpstan-baseline.neon
35+
36+
name-collision:
37+
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"phpstan/phpstan-strict-rules": "^2.0",
3838
"phpunit/phpunit": "^9.6.20",
3939
"ramsey/uuid": "^4.2",
40+
"shipmonk/name-collision-detector": "^2.1",
4041
"symfony/cache": "^5.4",
4142
"symfony/uid": "^5.4 || ^6.4 || ^7.3"
4243
},

0 commit comments

Comments
 (0)