134 karma · joined March 7, 2019
I guess the first attempt is always tricky, let's see if Go 2 can find a smooth upgrade path.
1. Definitely get a PHP IDE: https://www.jetbrains.com/phpstorm/
2. Get a step debugger and hook it in: https://xdebug.org/
3. Fix the code style: https://github.com/FriendsOfPHP/PHP-CS-Fixer
4. Run the code through some static analysis tools https://phpstan.org/ https://psalm.dev/
5. Upgrade the code with an AST fixer (might help you update to newer PHP version): https://github.com/rectorphp/rector
6. Add tests to it: https://phpunit.de/
7. Run mutation tests: https://infection.github.io/
The "0 budget" is rough, though.
When it gets back to you and all spans are merged, you can see the whole picture, but don't need to provide all the details all the way down.
What you want is having a Postgres server, but optimized for tests. What I've done is 1. One instance per pipeline 2. Parallelize by having separate databases per process 3. Build schema once 4. Before each test, purge the database (or run tests in transactions so you can just rollback in the end) 5. Run in Docker, use tmpfs volumes for writes (no disk writes)
It runs fairly quickly.
This PHP library allows you to define a PHP class and a mapping (using column names or header labels) how you'd like to transform the said Excel into the PHP value object. Then you iterate the Excel sheet one row at a time and get a PHP object for each row, which you can for example store to the DB via an ORM.
Since it's using Symfony Serializer, you can also create custom denormalizers, like converting a random date-ish string into an instance of \DateTime.
More features (like validation, proper streaming serializers for very large data sets, etc) are planned.