Migration classes do not comply with PSR-4 autoloading standard
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
After trying to run composer update (v 1.10.1), it started to complain about every single migration class not complying with PSR-4 autoloading standard and telling me it won't be autoloaded once we switch to composer v2.0.
All our migration classes reside in root/database/src/Migration and fall under namespace Pi\Database\Migration. As far as I can see, problem here is that each migration php file must be prefixed with timestamp and this timestamp is not used in class name and this is why it complains about PSR-4 standard.
I think one solution is would be to add timestamps to class names, are there any other ways to workaround this?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the migration classes under database/src/Migration and the project's PSR-4 autoload configuration. Reproduce the warnings with composer update, then determine a compatible approach for the timestamped migration filenames. Done means migrations load without PSR-4 warnings under Composer 2 while remaining usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100