classes/phing/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 1257 2011-08-08 12:29:41Z mrook $
\PhpCodeSnifferTask
A PHP code sniffer task. Checking the style of one or more PHP source files.
Use {@link Project#createTask} to register a new Task.
- Extends from
- \Task
- author
- Dirk Thomas
- copyright
- 2001,2002 THYRELL. All rights reserved
- package
- phing.tasks.ext
- version
- $Id: PhpCodeSnifferTask.php 1257 2011-08-08 12:29:41Z 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 |

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

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

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

outputCustomFormatMessages(
array $messages, string $type
)
:
Outputs 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 |

setAllowedFileExtensions(
array $extensions
)
:
Sets 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 |

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

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

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

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

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

setNoSubdirectories(
boolean $subdirectories
)
:
Sets 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
)
:
Sets 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
)
:
Sets the flag if warnings should be shown
| Name | Type | Description |
|---|---|---|
| $show | boolean |

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

setSniffs(
string $sniffs
)
:
Sets 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
)
:
Sets the tab width to replace tabs with spaces
| Name | Type | Description |
|---|---|---|
| $width | int |
\PhpCodeSnifferTask_FormatterElement
Base class for those classes that can appear inside the build file as stand alone data types.
This class handles the common description attribute and provides a default implementation for reference handling and checking for circular references that is appropriate for types that can not be nested inside elements of the same type (i.e. patternset but not path)
- Extends from
- \DataType
- author
- Andreas Aderhold
- author
- Hans Lellelid
- package
- phing.tasks.ext
- version
- $Revision: 526 $