Currently, exceptions are in Grifart\Stateful\Exceptions, but are defined in files section of autoloading. This probably mismatch PSR-4 standard as reported here (relevant SA question).
I suggest to move exceptions to the top-level namespace so it corresponds to where the file is placed actually. We use this pattern in apps as well so there is no point in doing it other way here, I think.
I suggest to move exceptions to the top-level namespace so it corresponds to where the file is placed actually.
Is that enough to get rid of the warnings?
I mean, if we truly want to adhere to PSR-4 then each exception has to go to its own separate file. That's insane to do in the top-level namespace because it would just pollute the source root, and I don't see the value in it under the Exceptions namespace either.
Hm, really, it didn't help. But I don't understand it. Why then, in CampApp, it doesn't complain when we use this exceptions.php pattern and here it does?
@jkuchar1 Well, I'm not still pretty sure what is the issue actually so I have nothing to update right now.
Current summary: I want to get rid of warnings in production build (composer install --optimize-autoloader) and now we're investigating what is the root cause. @jpudil says the warnings are reasonable but I can't see why they appear in here but not in CampApp where we use the same pattern.