Commit b86b6fc
fix: exclude .castor.stub.php from classmap to prevent interface redeclaration errors in PHP 8.2-8.3
The .castor.stub.php file is auto-generated by Castor and contains stub definitions for IDE support.
In PHP 8.2 and 8.3, when this file is loaded by Composer's autoloader during tests, it causes a fatal error:
'Cannot declare interface Psr\Cache\CacheItemInterface, because the name is already in use'
This happens because the stub file defines interfaces that are already defined in the project's PSR dependencies.
PHP 8.4 handles this differently and doesn't encounter the issue.
The fix adds 'exclude-from-classmap' configuration to exclude .castor.stub.php from Composer's autoloader,
preventing it from being loaded during test execution.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent a0023df commit b86b6fc
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| |||
0 commit comments