phing-tasks-ext
[ class tree: phing-tasks-ext ] [ index: phing-tasks-ext ] [ all elements ]

Class: PhpCodeSnifferTask

Source Location: /tasks/ext/PhpCodeSnifferTask.php

Class Overview

ProjectComponent
   |
   --Task
      |
      --PhpCodeSnifferTask

A PHP code sniffer task. Checking the style of one or more PHP source files.


Author(s):

Version:

  • $Id: PhpCodeSnifferTask.php 580 2009-09-26 00:18:07Z mrook $

Copyright:

  • � 2001,2002 THYRELL. All rights reserved

Variables

Methods


Inherited Variables

Inherited Methods

Class: Task

Task::getDescription()
Returns the textual description of the task
Task::getLocation()
Returns the location within the buildfile this task occurs. Used by BuildException to give detailed error messages.
Task::getOwningTarget()
Returns the owning target of this task.
Task::getRegisterSlot()
Returns a name
Task::getRuntimeConfigurableWrapper()
Returns the wrapper object for runtime configuration
Task::getTaskName()
Returns the name of task, used only for log messages
Task::getTaskType()
Returns the name of the task under which it was invoked, usually the XML tagname
Task::init()
Called by the parser to let the task initialize properly.
Task::log()
Provides a project level log event to the task.
Task::main()
Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running <em>phing target1 target2</em> will run all tasks in target3 twice.
Task::maybeConfigure()
Configure this task if it hasn't been done already.
Task::perform()
Perfrom this task
Task::setDescription()
Sets a textual description of the task
Task::setLocation()
Sets the location within the buildfile this task occurs. Called by the parser to set location information.
Task::setOwningTarget()
Sets the owning target this task belongs to.
Task::setRuntimeConfigurableWrapper()
Sets the wrapper object this task should use for runtime configurable elements.
Task::setTaskName()
Sets the name of this task for log messages
Task::setTaskType()
Sets the type of the task. Usually this is the name of the XML tag

Class: ProjectComponent

ProjectComponent::getProject()
Returns a reference to current project
ProjectComponent::log()
Logs a message with the given priority.
ProjectComponent::setProject()
References the project to the current component.

Class Details

[line 31]
A PHP code sniffer task. Checking the style of one or more PHP source files.



Tags:

author:  Dirk Thomas <dirk.thomas@4wdmedia.de>
version:  $Id: PhpCodeSnifferTask.php 580 2009-09-26 00:18:07Z mrook $
copyright:  � 2001,2002 THYRELL. All rights reserved


[ Top ]


Class Variables

$allowedFileExtensions = array('php')

[line 42]



Tags:

access:  protected

Type:   mixed


[ Top ]

$configData = array()

[line 45]



Tags:

access:  protected

Type:   mixed


[ Top ]

$file =

[line 33]



Tags:

access:  protected

Type:   mixed


[ Top ]

$filesets = array()

[line 34]



Tags:

access:  protected

Type:   mixed


[ Top ]

$format =  'default'

[line 49]



Tags:

access:  protected

Type:   mixed


[ Top ]

$formatters = array()

[line 50]



Tags:

access:  protected

Type:   mixed


[ Top ]

$ignorePatterns =  false

[line 43]



Tags:

access:  protected

Type:   mixed


[ Top ]

$noSubdirectories =  false

[line 44]



Tags:

access:  protected

Type:   mixed


[ Top ]

$showSniffs =  false

[line 48]



Tags:

access:  protected

Type:   mixed


[ Top ]

$showWarnings =  true

[line 39]



Tags:

access:  protected

Type:   mixed


[ Top ]

$sniffs = array()

[line 38]



Tags:

access:  protected

Type:   mixed


[ Top ]

$standard =  'Generic'

[line 37]



Tags:

access:  protected

Type:   mixed


[ Top ]

$tabWidth =  0

[line 41]



Tags:

access:  protected

Type:   mixed


[ Top ]

$verbosity =  0

[line 40]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


method createConfig [line 168]

Parameter createConfig( )

Creates a config parameter for this task



Tags:

return:  The created parameter
access:  public


[ Top ]

method createFileSet [line 68]

FileSet createFileSet( )

Nested creator, creates a FileSet for this task



Tags:

return:  The created fileset object


[ Top ]

method createFormatter [line 195]

CodeSniffer_FormatterElement createFormatter( )

Create object for nested formatter element.



Tags:

access:  public


[ Top ]

method main [line 222]

void main( )

Executes PHP code sniffer against PhingFile or a FileSet



Tags:

access:  public


Overrides Task::main() (Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running <em>phing target1 target2</em> will run all tasks in target3 twice.)

[ Top ]

method output [line 289]

void output( PHP_CodeSniffer $codeSniffer)

Outputs the results



Tags:

access:  protected


Parameters:

PHP_CodeSniffer   $codeSniffer  

[ Top ]

method outputCustomFormat [line 377]

void outputCustomFormat( PHP_CodeSniffer $codeSniffer)

Outputs the results with a custom format



Tags:

access:  protected


Parameters:

PHP_CodeSniffer   $codeSniffer  

[ Top ]

method outputCustomFormatMessages [line 415]

void outputCustomFormatMessages( array $messages, string $type)

Outputs the messages of a specific type for one file



Tags:

access:  protected


Parameters:

array   $messages  
string   $type  

[ Top ]

method setAllowedFileExtensions [line 128]

void setAllowedFileExtensions( array $extensions)

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



Tags:

access:  public


Parameters:

array   $extensions  

[ Top ]

method setFile [line 59]

void setFile( $file)

File to be performed syntax check on



Tags:

access:  public


Parameters:

PhingFile   $file  

[ Top ]

method setFormat [line 186]

void setFormat( string $format)

Sets the output format



Tags:

access:  public


Parameters:

string   $format  

[ Top ]

method setHaltonerror [line 205]

void setHaltonerror( boolean $value)

Sets the haltonerror flag



Parameters:

boolean   $value  

[ Top ]

method setHaltonwarning [line 214]

void setHaltonwarning( boolean $value)

Sets the haltonwarning flag



Parameters:

boolean   $value  

[ Top ]

method setIgnorePatterns [line 143]

void setIgnorePatterns( $patterns, array $extensions)

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



Tags:

access:  public


Parameters:

array   $extensions  
   $patterns  

[ Top ]

method setNoSubdirectories [line 158]

void setNoSubdirectories( boolean $subdirectories)

Sets the flag if subdirectories should be skipped



Tags:

access:  public


Parameters:

boolean   $subdirectories  

[ Top ]

method setShowSniffs [line 177]

void setShowSniffs( boolean $show)

Sets the flag if the used sniffs should be listed



Tags:

access:  public


Parameters:

boolean   $show  

[ Top ]

method setShowWarnings [line 101]

void setShowWarnings( boolean $show)

Sets the flag if warnings should be shown



Tags:

access:  public


Parameters:

boolean   $show  

[ Top ]

method setSniffs [line 87]

void setSniffs( string $sniffs)

Sets the sniffs which the standard should be restricted to



Tags:

access:  public


Parameters:

string   $sniffs  

[ Top ]

method setStandard [line 77]

void setStandard( string $standard)

Sets the standard to test for



Tags:

access:  public


Parameters:

string   $standard  

[ Top ]

method setTabWidth [line 119]

void setTabWidth( int $width)

Sets the tab width to replace tabs with spaces



Tags:

access:  public


Parameters:

int   $width  

[ Top ]

method setVerbosity [line 110]

void setVerbosity( int $level)

Sets the verbosity level



Tags:

access:  public


Parameters:

int   $level  

[ Top ]


Documentation generated on Mon, 19 Oct 2009 10:51:37 +0200 by phpDocumentor 1.4.3