tasks/ext/PhpCodeSnifferTask.php

Show: inherited
Table of Contents

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

Package: phing\tasks\ext

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

Propertyprotected  $allowedFileExtensions= 'array('php')'
Default valuearray('php')Details
Type
n/a
Propertyprotected  $configData= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected\PhingFile  $docFile= 'null'

Holds the outfile for the documentation

Default valuenullDetails
Type
\PhingFile
Propertyprotectedstring  $docGenerator= ''''

Holds the type of the doc generator

Default value''Details
Type
string
Propertyprotected  $encoding= ''iso-8859-1''
Default value'iso-8859-1'Details
Type
n/a
Propertyprotected  $file= ''
Details
Type
n/a
Propertyprotected  $filesets= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected  $format= ''default''
Default value'default'Details
Type
n/a
Propertyprotected  $formatters= 'array()'
Default valuearray()Details
Type
n/a
Propertyprivate  $haltonerror= 'false'
Default valuefalseDetails
Type
n/a
Propertyprivate  $haltonwarning= 'false'
Default valuefalseDetails
Type
n/a
Propertyprotected  $ignorePatterns= 'false'
Default valuefalseDetails
Type
n/a
Propertyprotected  $noSubdirectories= 'false'
Default valuefalseDetails
Type
n/a
Propertyprotected  $reportWidth= '80'
Default value80Details
Type
n/a
Propertyprotected  $showSniffs= 'false'
Default valuefalseDetails
Type
n/a
Propertyprotected  $showSources= 'false'
Default valuefalseDetails
Type
n/a
Propertyprotected  $showWarnings= 'true'
Default valuetrueDetails
Type
n/a
Propertyprivate  $skipVersionCheck= 'false'
Default valuefalseDetails
Type
n/a
Propertyprotected  $sniffs= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected  $standard= ''Generic''
Default value'Generic'Details
Type
n/a
Propertyprotected  $tabWidth= '0'
Default value0Details
Type
n/a
Propertyprotected  $verbosity= '0'
Default value0Details
Type
n/a

Methods

methodpubliccreateConfig( ) : \Parameter

Creates a config parameter for this task

Returns
Type Description
\Parameter The created parameter
methodpubliccreateFileSet( ) : \FileSet

Nested creator, creates a FileSet for this task

Returns
Type Description
\FileSet The created fileset object
methodpubliccreateFormatter( ) : \CodeSniffer_FormatterElement

Create object for nested formatter element.

Returns
Type Description
\CodeSniffer_FormatterElement
methodpublicgetDescription( ) : void

methodpublicgetLocation( ) : void

methodpublicgetOwningTarget( ) : void

methodpublicgetProject( ) : void

methodprotectedgetRegisterSlot( ) : void

methodpublicgetRuntimeConfigurableWrapper( ) : void

methodpublicgetTaskName( ) : void

methodpublicgetTaskType( ) : void

methodpublicinit( ) : void

Load the necessary environment for running PHP_CodeSniffer.

methodpubliclog( ) : void

methodpublicmain( ) : void

Executes PHP code sniffer against PhingFile or a FileSet

methodpublicmaybeConfigure( ) : void

methodprotectedoutputCustomFormat( array $report ) : void

Outputs the results with a custom format

Parameters
Name Type Description
$report array

Packaged list of all errors in each file

methodprotectedoutputCustomFormatMessages( array $messages, string $type ) : void

Outputs the messages of a specific type for one file

Parameters
Name Type Description
$messages array
$type string
methodpublicperform( ) : void

methodprotectedprintErrorReport( \PHP_CodeSniffer $phpcs ) : int

Prints the error report.

Parameters
Name Type Description
$phpcs \PHP_CodeSniffer

The PHP_CodeSniffer object containing the errors.

Returns
Type Description
int The number of error and warning messages shown.
methodpublicsetAllowedFileExtensions( array $extensions ) : void

Sets the allowed file extensions when using directories instead of specific files

Parameters
Name Type Description
$extensions array
methodpublicsetDescription( ) : void

methodpublicsetDocFile( \PhingFile $file ) : void

Sets the outfile for the documentation

Parameters
Name Type Description
$file \PhingFile

The outfile for the doc

methodpublicsetDocGenerator( string $generator ) : void

Sets the type of the doc generator

Parameters
Name Type Description
$generator string

HTML or Text

methodpublicsetEncoding( string $encoding ) : void

Sets file encoding

Parameters
Name Type Description
$encoding string
methodpublicsetFile( \PhingFile $file ) : void

File to be performed syntax check on

Parameters
Name Type Description
$file \PhingFile
methodpublicsetFormat( string $format ) : void

Sets the output format

Parameters
Name Type Description
$format string
methodpublicsetHaltonerror( boolean $value ) : void

Sets the haltonerror flag

Parameters
Name Type Description
$value boolean
methodpublicsetHaltonwarning( boolean $value ) : void

Sets the haltonwarning flag

Parameters
Name Type Description
$value boolean
methodpublicsetIgnorePatterns(  $patterns ) : void

Sets the ignore patterns to skip files when using directories instead of specific files

Parameters
Name Type Description
$patterns
methodpublicsetLocation( ) : void

methodpublicsetNoSubdirectories( boolean $subdirectories ) : void

Sets the flag if subdirectories should be skipped

Parameters
Name Type Description
$subdirectories boolean
methodpublicsetOwningTarget( ) : void

methodpublicsetProject( ) : void

methodpublicsetReportWidth( int $width ) : void

Sets the width of the report

Parameters
Name Type Description
$width int

How wide the screen reports should be.

methodpublicsetRuntimeConfigurableWrapper( ) : void

methodpublicsetShowSniffs( boolean $show ) : void

Sets the flag if the used sniffs should be listed

Parameters
Name Type Description
$show boolean
methodpublicsetShowSources( boolean $show ) : void

Sets the flag if sources should be shown

Parameters
Name Type Description
$show boolean

Whether to show sources or not

methodpublicsetShowWarnings( boolean $show ) : void

Sets the flag if warnings should be shown

Parameters
Name Type Description
$show boolean
methodpublicsetSkipVersionCheck( boolean $value ) : void

Sets the skipversioncheck flag

Parameters
Name Type Description
$value boolean
methodpublicsetSniffs( string $sniffs ) : void

Sets the sniffs which the standard should be restricted to

Parameters
Name Type Description
$sniffs string
methodpublicsetStandard( string $standard ) : void

Sets the coding standard to test for

Parameters
Name Type Description
$standard string

The coding standard

methodpublicsetTabWidth( int $width ) : void

Sets the tab width to replace tabs with spaces

Parameters
Name Type Description
$width int
methodpublicsetTaskName( ) : void

methodpublicsetTaskType( ) : void

methodpublicsetVerbosity( int $level ) : void

Sets the verbosity level

Parameters
Name Type Description
$level int

\PhpCodeSnifferTask_FormatterElement

Package: phing\tasks\ext

Parent(s)
\DataType < \ProjectComponent

Properties

Propertyprotectedstring  $outfile= '""'

Output file.

Default value""Details
Type
string
Propertyprotectedstring  $type= '""'

Type of output to generate

Default value""Details
Type
string
Propertyprotectedbool  $useFile= 'true'

Output to file?

Default valuetrueDetails
Type
bool

Methods

methodpubliccircularReference( ) : void

methodpublicdieOnCircularReference( ) : void

methodpublicgetCheckedRef( ) : void

methodpublicgetDescription( ) : void

methodpublicgetOutfile( ) : void

methodpublicgetProject( ) : void

methodpublicgetType( ) : void

methodpublicgetUseFile( ) : void

methodpublicisReference( ) : void

methodpubliclog( ) : void

methodpublicnoChildrenAllowed( ) : void

methodpublicparsingComplete( ) : void

Validate config.

methodpublicsetDescription( ) : void

methodpublicsetOutfile(  $outfile ) : void

Parameters
Name Type Description
$outfile
methodpublicsetProject( ) : void

methodpublicsetRefid( ) : void

methodpublicsetType(  $type ) : void

Parameters
Name Type Description
$type
methodpublicsetUseFile(  $useFile ) : void

Parameters
Name Type Description
$useFile
methodpublictooManyAttributes( ) : void

Documentation was generated by DocBlox 0.17.1.