Using the v4 version of nikic/php-parser causes various errors when the code is run.
This is not showing up in the tests at the moment because the require-dev section needs sami which locks the version to 3. Removing this requirement will bring in the latest version and show the errors.
I've done this in a fork so the errors can be seen, the travis output is here https://travis-ci.org/edmondscommerce/php-code-generator/jobs/422187128