File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010/phpstan-baseline.neon export-ignore
1111/phpunit.xml export-ignore
1212/CLAUDE.md export-ignore
13+ collision-detector.json export-ignore
Original file line number Diff line number Diff line change @@ -317,3 +317,29 @@ jobs:
317317 with :
318318 path : ./tmp
319319 key : " result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
320+
321+ name-collision :
322+ name : " Name Collision Detector"
323+
324+ runs-on : " ubuntu-latest"
325+ timeout-minutes : 60
326+
327+ steps :
328+ - name : Harden the runner (Audit all outbound calls)
329+ uses : step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
330+ with :
331+ egress-policy : audit
332+
333+ - name : " Checkout"
334+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
335+
336+ - name : " Install PHP"
337+ uses : " shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
338+ with :
339+ coverage : " none"
340+ php-version : " 8.5"
341+
342+ - uses : " ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
343+
344+ - name : " Name Collision Detector"
345+ run : " make name-collision"
Original file line number Diff line number Diff line change @@ -31,3 +31,6 @@ phpstan:
3131.PHONY : phpstan-generate-baseline
3232phpstan-generate-baseline :
3333 php vendor/bin/phpstan analyse -c phpstan.neon -b phpstan-baseline.neon
34+
35+ name-collision :
36+ php vendor/bin/detect-collisions --configuration collision-detector.json
Original file line number Diff line number Diff line change 1+ {
2+ "scanPaths" : [" src" , " tests" ]
3+ }
Original file line number Diff line number Diff line change 1818 "php-parallel-lint/php-parallel-lint" : " ^1.2" ,
1919 "phpstan/phpstan-deprecation-rules" : " ^2.0" ,
2020 "phpstan/phpstan-strict-rules" : " ^2.0" ,
21- "phpunit/phpunit" : " ^9.6"
21+ "phpunit/phpunit" : " ^9.6" ,
22+ "shipmonk/name-collision-detector" : " ^2.1"
2223 },
2324 "config" : {
2425 "sort-packages" : true
Original file line number Diff line number Diff line change 11<?php declare (strict_types = 1 );
22
3- namespace ExampleTestCase ;
3+ namespace ExampleTestCaseAsserts ;
44
55class FooTestCase extends \PHPUnit \Framework \TestCase
66{
Original file line number Diff line number Diff line change 11<?php
22
3- namespace AssertFunction ;
3+ namespace AssertFunction96 ;
44
55use function PHPStan \Testing \assertType ;
66use function PHPUnit \Framework \assertObjectHasProperty ;
You can’t perform that action at this time.
0 commit comments