4 ms·
As others have said, you're in a precarious position: working with pure tech debt for a business that clearly has no interest in addressing tech debt. First th
by MattyRad 4y ago
As others have said, you're in a precarious position: working with pure tech debt for a business that clearly has no interest in addressing tech debt.
First thing would be to use source control and get some sort of code review/release process in place.
Contrary to other suggestions of "then write tests for everything", I think that's bad advice. It's far more likely that you'll pigeonhole yourself and your team on complicated and unhelpful tests, particularly with dead code and trying to enumerate all the features that aren't documented. 3 things you could do in a short amount of time to radically increase the code quality:
- Lint all the code (php-cs-fixer is a good tool, rector can also help)
- At least start dependency management (with composer), even if it's empty.
- Introduce static analysis into the code review process (phpstan/psalm, in a CI preferably). Baseline suppression of existing errors are easy to generate.
Then personally I would try and aggressively purge dead code, which is easier said than done. Tombs (https://github.com/krakjoe/tombs https://github.com/krakjoe/tombs) is a little awkward but can be helpful, especially if all there is is production. It requires PHP 7.1, I'm assuming you're below that, but the good news is that every route is in nginx; you can upgrade PHP piecemeal.
Again, handling tech debt sounds like it will be nigh impossible at this company, but modern PHP is really enjoyable and I hope you're able to experience it.