tasks/ext/PhpCodeSnifferTask.php
A PHP code sniffer task. Checking the style of one or more PHP source files.
- Author
- Dirk Thomas
- Package
- phing.tasks.ext
- Version
- $Id: PhpCodeSnifferTask.php 1330 2011-10-21 13:36:28Z mrook $
\PhpCodeSnifferTask
A PHP code sniffer task. Checking the style of one or more PHP source files.
- Parent(s)
- \Task < \ProjectComponent
- Author
- Dirk Thomas
- Version
- $Id: PhpCodeSnifferTask.php 1330 2011-10-21 13:36:28Z mrook $
Properties

\PhingFile
$docFile= 'null'
Holds the outfile for the documentation
nullDetails- Type
- \PhingFile
Methods

createConfig(
)
:
\ParameterCreates a config parameter for this task
| Type | Description |
|---|---|
| \Parameter | The created parameter |

createFileSet(
)
:
\FileSetNested creator, creates a FileSet for this task
| Type | Description |
|---|---|
| \FileSet | The created fileset object |

createFormatter(
)
:
\CodeSniffer_FormatterElementCreate object for nested formatter element.
| Type | Description |
|---|---|
| \CodeSniffer_FormatterElement |

outputCustomFormat(
array $report
)
:
voidOutputs the results with a custom format
| Name | Type | Description |
|---|---|---|
| $report | array | Packaged list of all errors in each file |

outputCustomFormatMessages(
array $messages, string $type
)
:
voidOutputs the messages of a specific type for one file
| Name | Type | Description |
|---|---|---|
| $messages | array | |
| $type | string |

printErrorReport(
\PHP_CodeSniffer $phpcs
)
:
intPrints the error report.
| Name | Type | Description |
|---|---|---|
| $phpcs | \PHP_CodeSniffer | The PHP_CodeSniffer object containing the errors. |
| Type | Description |
|---|---|
| int | The number of error and warning messages shown. |

setAllowedFileExtensions(
array $extensions
)
:
voidSets the allowed file extensions when using directories instead of specific files
| Name | Type | Description |
|---|---|---|
| $extensions | array |

setDocFile(
\PhingFile $file
)
:
voidSets the outfile for the documentation
| Name | Type | Description |
|---|---|---|
| $file | \PhingFile | The outfile for the doc |

setDocGenerator(
string $generator
)
:
voidSets the type of the doc generator
| Name | Type | Description |
|---|---|---|
| $generator | string | HTML or Text |

setEncoding(
string $encoding
)
:
voidSets file encoding
| Name | Type | Description |
|---|---|---|
| $encoding | string |

setFile(
\PhingFile $file
)
:
voidFile to be performed syntax check on
| Name | Type | Description |
|---|---|---|
| $file | \PhingFile |

setFormat(
string $format
)
:
voidSets the output format
| Name | Type | Description |
|---|---|---|
| $format | string |

setHaltonerror(
boolean $value
)
:
voidSets the haltonerror flag
| Name | Type | Description |
|---|---|---|
| $value | boolean |

setHaltonwarning(
boolean $value
)
:
voidSets the haltonwarning flag
| Name | Type | Description |
|---|---|---|
| $value | boolean |

setIgnorePatterns(
$patterns
)
:
voidSets the ignore patterns to skip files when using directories instead of specific files
| Name | Type | Description |
|---|---|---|
| $patterns |

setNoSubdirectories(
boolean $subdirectories
)
:
voidSets the flag if subdirectories should be skipped
| Name | Type | Description |
|---|---|---|
| $subdirectories | boolean |

setReportWidth(
int $width
)
:
voidSets the width of the report
| Name | Type | Description |
|---|---|---|
| $width | int | How wide the screen reports should be. |

setShowSniffs(
boolean $show
)
:
voidSets the flag if the used sniffs should be listed
| Name | Type | Description |
|---|---|---|
| $show | boolean |

setShowSources(
boolean $show
)
:
voidSets the flag if sources should be shown
| Name | Type | Description |
|---|---|---|
| $show | boolean | Whether to show sources or not |

setShowWarnings(
boolean $show
)
:
voidSets the flag if warnings should be shown
| Name | Type | Description |
|---|---|---|
| $show | boolean |

setSkipVersionCheck(
boolean $value
)
:
voidSets the skipversioncheck flag
| Name | Type | Description |
|---|---|---|
| $value | boolean |

setSniffs(
string $sniffs
)
:
voidSets the sniffs which the standard should be restricted to
| Name | Type | Description |
|---|---|---|
| $sniffs | string |

setStandard(
string $standard
)
:
voidSets the coding standard to test for
| Name | Type | Description |
|---|---|---|
| $standard | string | The coding standard |

setTabWidth(
int $width
)
:
voidSets the tab width to replace tabs with spaces
| Name | Type | Description |
|---|---|---|
| $width | int |