From d22fe84109d1b8fcfec4a201aa8f9027e4a519f4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 6 May 2026 08:02:49 +0200 Subject: [PATCH] name-collision-detector --- .github/workflows/lint-workflows.yml | 26 ++++++++++++++++++++++++++ Makefile | 4 ++++ collision-detector.json | 3 +++ composer.json | 3 ++- 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 collision-detector.json diff --git a/.github/workflows/lint-workflows.yml b/.github/workflows/lint-workflows.yml index 92a5729..3b38a73 100644 --- a/.github/workflows/lint-workflows.yml +++ b/.github/workflows/lint-workflows.yml @@ -111,3 +111,29 @@ jobs: sarif_file: results.sarif category: zizmor wait-for-processing: false + + name-collision: + name: "Name Collision Detector" + + runs-on: "ubuntu-latest" + timeout-minutes: 60 + + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 + with: + egress-policy: audit + + - name: "Checkout" + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + + - name: "Install PHP" + uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2 + with: + coverage: "none" + php-version: "8.5" + + - uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3 + + - name: "Name Collision Detector" + run: "make name-collision" diff --git a/Makefile b/Makefile index b2b6703..6d79b27 100644 --- a/Makefile +++ b/Makefile @@ -27,3 +27,7 @@ cs-fix: .PHONY: phpstan phpstan: php vendor/bin/phpstan analyse -l 8 -c phpstan.neon src tests + +name-collision: + php vendor/bin/detect-collisions --configuration collision-detector.json + diff --git a/collision-detector.json b/collision-detector.json new file mode 100644 index 0000000..1d85c2b --- /dev/null +++ b/collision-detector.json @@ -0,0 +1,3 @@ +{ + "scanPaths": ["src", "tests"] +} diff --git a/composer.json b/composer.json index f7c12b5..055e230 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^9.6", + "shipmonk/name-collision-detector": "^2.1" }, "config": { "platform": {