Skip to content

Commit 016d677

Browse files
authored
name-collision-detector (#187)
1 parent 945df12 commit 016d677

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
@@ -11,3 +11,4 @@ Makefile export-ignore
1111
phpstan.neon export-ignore
1212
phpstan-baseline.neon export-ignore
1313
phpunit.xml export-ignore
14+
collision-detector.json export-ignore

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,29 @@ jobs:
262262
with:
263263
path: ./tmp
264264
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
265+
266+
name-collision:
267+
name: "Name Collision Detector"
268+
269+
runs-on: "ubuntu-latest"
270+
timeout-minutes: 60
271+
272+
steps:
273+
- name: Harden the runner (Audit all outbound calls)
274+
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
275+
with:
276+
egress-policy: audit
277+
278+
- name: "Checkout"
279+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
280+
281+
- name: "Install PHP"
282+
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
283+
with:
284+
coverage: "none"
285+
php-version: "8.5"
286+
287+
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
288+
289+
- name: "Name Collision Detector"
290+
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 -c phpstan.neon
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
@@ -13,7 +13,8 @@
1313
"require-dev": {
1414
"php-parallel-lint/php-parallel-lint": "^1.2",
1515
"phpstan/phpstan-phpunit": "^2.0",
16-
"phpunit/phpunit": "^9.6"
16+
"phpunit/phpunit": "^9.6",
17+
"shipmonk/name-collision-detector": "^2.1"
1718
},
1819
"config": {
1920
"platform": {

0 commit comments

Comments
 (0)