Skip to content

Engineering Tools

We have multiple tools at our disposal to help us do our jobs. This page lists the tools we use and how to use them.

Tinkerwell

Tinkerwell is a desktop app that allows you to run PHP code in a Laravel application. It's a great tool for debugging and testing code.

Get a license key from your local engineering manager, then download and install the app from the Tinkerwell website.

PHPStan

PHPStan is a static code analyzer for PHP. It can run over a code base and warn about potential errors. We use Larastan to help PHPStan understand Laravel's magic better.

This tool runs on every GitHub pull request on our carandclassic/carandclassic repository and it is marked as required, so any failures will block merging.

We have a baseline file (phpstan-baseline.neon) that is used to keep track of existing issues and will be compared against when this tool is run. If it is reported that an existing error is now fixed, it is recommended to search for the filename in the baseline file, find the error that has been fixed and then remove the entry manually.

If you do need to rerun baseline generator, you can use the following command running from the repository root:

./bin/car phpstan analyze --memory-limit=2G --generate-baseline

But be careful, as this might accidentally introduce new errors.

Note that this command can be quite resource intensive on your local machine. If you would prefer to customize the config for this you can do this by:

  1. Creating a new file named phpstan.neon with the following content:
includes:
    - phpstan.dist.neon
  1. Then add any config options listed in the documentation, however any settings also declared in other included phpstan.neon configs will clash and throw an error, for instance if it duplicates a setting already defined in the main phpstan.dist.neon config.

Example config that adjust the parallel settings:

includes:
    - phpstan.dist.neon

parameters:
    parallel:
        jobSize: 10
        maximumNumberOfProcesses: 16
        minimumNumberOfJobsPerProcess: 5

PHPStan will automatically pick up the new file and you should see a notice indicating which config it is using when the command is run.