-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Description
Complete error message:
(occurs when running php artisan generate:model-factory)
PHP Fatal error: Cannot declare class PragmaRX\Tracker\Data\Repositories\Session, because the name is already in use in /app/VendorOverrides/PragmaRX/Tracker/Data/Repositories/Session.php on line 330
Symfony\Component\Debug\Exception\FatalErrorException: Cannot declare class PragmaRX\Tracker\Data\Repositories\Session, because the name is already in use
Background:
The PragmaRX Tracker package hasn't merged an important fix, so I've had to override it in my app with composer magic.
composer.json:
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
+ "files": ["app/VendorOverrides/PragmaRX/Tracker/Data/Repositories/Session.php"],
"psr-4": {
"App\\": "app/"
}
},So, yes, my app does actually re-declare that class, but composer knows how to handle it.
Possible Solutions:
- Bandage: add an "exclude" flag to the
generate:model-factorycommand, where we can list the things (ie: directories probably) to ignore. - Auto-ignore things listed in
composer.json'sautoload.fileskey. - Catch the error and just ignore it, instead of fatal abort.
- Tell the user (me!) I'm doing it wrong! (ie: I guess I could put these overrides outside
app)
Metadata
Metadata
Assignees
Labels
No labels