Forrest logo
back to the phpcbf tool

phpcbf:tldr:4ecee

phpcbf: Don't recurse into subdirectories.
$ phpcbf ${path-to-directory} -l
try on your machine

The command "phpcbf ${path-to-directory} -l" performs a code formatting on PHP files present in the specified directory.

Here's a breakdown of the command components:

  • "phpcbf": This is the command used to run PHP Code Beautifier and Fixer (phpcbf), which is a tool used for automatically formatting PHP code to adhere to a specific coding style.

  • "${path-to-directory}": This is a placeholder that should be replaced with the actual path to the directory containing the PHP files that you want to format. For example, if your PHP files are located in the "/var/www/html" directory, you would replace "${path-to-directory}" with "/var/www/html".

  • "-l": This flag is used to list the files that need to be changed without actually modifying them. It allows you to see which files would be affected by the formatting process before applying any changes.

In summary, the command "phpcbf ${path-to-directory} -l" runs the PHPCBF tool on the specified directory, providing a list of files that would be modified without actually changing any files. This helps you preview the changes that would occur during code formatting.

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 phpcbf tool