Forrest logo
back to the php-cs-fixer tool

php-cs-fixer:tldr:2e592

php-cs-fixer: Execute code style linting without applying changes.
$ php-cs-fixer fix --dry-run
try on your machine

The command "php-cs-fixer fix --dry-run" is used to check and display the potential fixes that would be applied to PHP code files by the PHP CS Fixer tool without actually modifying the files.

Here is a breakdown of the command:

  • "php-cs-fixer" is the name of the command or executable script used to run the PHP CS Fixer tool.

  • "fix" is a subcommand of the PHP CS Fixer tool, which is used to fix the issues in PHP code files automatically.

  • "--dry-run" is an option or flag that instructs the PHP CS Fixer tool to perform a trial run without making any actual changes to the files. It allows you to review the proposed modifications before applying them, so you can ensure that the changes are as expected and won't introduce any unintended consequences.

Running this command will display a report highlighting the code issues that would be fixed if you were to execute the command without the "--dry-run" option. The report typically includes information about the modifications that would be made, such as the file names, number of changed lines, and the applied fixes for each file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the php-cs-fixer tool