Forrest logo
back to the phpcs tool

phpcs:tldr:0c46d

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

This command is using the phpcs tool to perform a code review on a specified directory. Here is the breakdown of the command:

  1. phpcs: It is the executable command for PHP Code Sniffer (phpcs), which is a widely used tool for detecting coding standards violations in PHP code.

  2. ${path-to-directory}: This is a placeholder representing the actual path to the directory you want to analyze. You need to replace ${path-to-directory} with the actual directory path in the command. For example, /path/to/my/directory.

  3. -l: This is an optional command-line argument for phpcs. The -l flag stands for "show both the line number and the line content." When included, it instructs phpcs to display both the line number and relevant source code for any detected coding standard violations.

So, when you run the command phpcs ${path-to-directory} -l, PHP Code Sniffer will analyze the PHP files in the specified directory and show a report highlighting any violations found along with the corresponding line numbers and code snippets where the violations occur.

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