Shift with red gradient lettering

Customizing the code style

Configure Shift to apply your own custom code style.

Watch Next

Building tasks with the Workbench

Automate everyday code refactors using the Shift Workbench.

Configuring Shift

Configure Shifts behavior by adding a .shiftrc file.

Gaining confidence with tests

Pair Shift with tests for the most automation.

Transcript

Some Laravel Shifts automatically apply code style to your application code.

Doing so improves the automation within Shift by normalizing the code between new and old versions of core files.

By default, this code style follows the Laravel framework code style. Although Shift recommends adopting this code style, it may not follow your personal code style.

If you wish to control the code style applied, you may add a .php_cs file if you use PHP CS Fixer or phpcs.xml if you use PHP CodeSniffer. No additional configuration is required.

Shift will detect this file and use it to apply your code style whenever it formats application code.

If you are not using one of these tools to format your code, Shift recommends using PHP CS Fixer.

The latest .php_cs ruleset Shift uses is publicly available in a Gist. Feel free to use this as a starting point for your own customization.

Sign in with any of the following services to connect Shift with your Laravel project.


Don't use one of these services?

Temporarily push your project to a free, private repository on one of these cloud-based services or upgrade your project locally with Shift for Docker.