This task runs PHP_CodeSniffer Version 3+ to detect violations of a defined set of coding standards.
Table C.85: Attributes
Name | Type | Description | Default | Required |
---|---|---|---|---|
file | String | File or directory to check. | n/a | Yes |
bin | String | Path to phpcs binary. | phpcs | No |
standard | String | The list of coding standards to test against. Separated by space, comma or semicolon. | No | |
format | String | The output format. (ex checkstyle , full , summary , ...) | No | |
outfile | String | Filename to write output/report to. If not set output will be sent to STDOUT. | n/a | No |
cache | Boolean | Cache results between runs. | false | No |
ignoreAnnotations | Boolean | Ignore all phpcs annotations in code comments. | false | No |
checkreturn | Boolean | Whether to check the return code. | false | No |
level | String | Set the log level of generated messages.
Change this to verbose ,
if you only want output in verbose mode for example.
Valid log levels are one of
debug ,
info ,
verbose ,
warning or
error | info | No |
FileSet
Formatter
The results of the tests can be printed in different formats. Output will
always be sent to a file, unless you set the usefile
attribute to false.
Table C.86: Attributes
Name | Type | Description | Default | Required |
---|---|---|---|---|
type | String | The output format. Accepts the same values as the
format attribute
(default , xml ,
checkstyle , csv ,
report , summary
& doc ). | n/a | Yes |
outfile | String | Path to write output file to. | n/a | Yes |