This task runs PHP_CodeSniffer to detect violations of a defined set of coding standards.
Table 126. Attributes
Name | Type | Description | Default | Required |
---|---|---|---|---|
standard |
String |
The name of the standard to check for. | Generic | No |
format |
String |
The output format. The default format is specified
in the task itself. Additionally all report formats of PHP_CodeSniffer
can be choosen (ex. checkstyle ,
full , summary , ...).
|
default | No Ignored if nested formatter elements are
supplied.
|
showSniffs |
Boolean |
Print the list of used sniffs. | false |
No |
showWarnings |
Boolean |
Print warnings. | true |
No |
showSources |
Boolean |
Flag that determines whether to show sources or not. | true |
No |
docGenerator |
String |
The name of the doc generator (HTML, Text). | n/a | No |
docFile |
String |
Path to write output file to. If not set documentation will be
written to STDOUT when docGenerator is set.
|
n/a | No |
file |
String |
The file or folder to check (usually the nested tag
fileset is used instead).
|
false |
Either this attribute or the nested tag fileset is
required.
|
sniffs |
String |
The list of allowed sniffs (separated by space, comma or semicolon). The sniffs must be part of the choosen standard. | n/a | No |
verbosity |
Integer |
The verbosity level of CodeSniffer where level 1 prints progress information and level 2 prints developer debug information. | 0 | No |
encoding |
String |
The encoding of the files to check | iso-8859-1 | No |
tabWidth |
Integer |
Replaces tabs with the given number of spaces. If zero no replacing is done. | 0 | No |
reportWidth |
Integer |
The max. width for the report. | 80 | No |
allowedFileExtensions |
String |
The allowed file extensions / file types to process. Separated by space, comma or semicolon. | php, inc, js, css | No |
ignorePatterns |
String |
The patterns to ignore files and folders (separated by space, comma
or semicolon) when a directory is specified in the
file attribute.
|
n/a | No |
noSubdirectories |
Boolean |
Do not recurse into subdirectories when a directory is specified in
the file attribute.
|
false |
No |
haltonerror |
Boolean |
Stop the build process if errors occurred during the run. | false |
No |
haltonwarning |
Boolean |
Stop the build process if warnings occurred during the run. | false |
No |
skipversioncheck |
Boolean |
Skips the version check when the task starts. | false |
No |