classes/phing/tasks/ext/phpmd/PHPMDTask.php

\PHPMDTask

Runs PHP Mess Detector. Checking PHP files for several potential problems based on rulesets.

Use {@link Project#createTask} to register a new Task.

Extends from
\Task
author
Benjamin Schultz
copyright
2001,2002 THYRELL. All rights reserved
package
phing.tasks.ext.phpmd
since
2.4.1
version
$Id: PHPMDTask.php 1223 2011-07-15 19:27:56Z mrook $

Properties

Propertyprotectedarray  $allowedFileExtensions= 'array'

List of valid file extensions for analyzed files.

Default valuearrayDetails
Type
array
Propertyprotected\PhingFile  $file= 'null'

A php source code filename or directory

Default valuenullDetails
Type
\PhingFile
Propertyprotected\array<FileSet>  $filesets= 'array'

All fileset objects assigned to this task

Default valuearrayDetails
Type
\array<FileSet>
Propertyprotectedstring  $format= 'text'

The format for the report

Default valuetextDetails
Type
string
Propertyprotected\array<PHPMDFormatterElement>  $formatters= 'array'

Formatter elements.

Default valuearrayDetails
Type
\array<PHPMDFormatterElement>
Propertyprotectedarray  $ignorePatterns= 'array'

List of exclude directory patterns.

Default valuearrayDetails
Type
array
Propertyprotectedinteger  $minimumPriority= '5'

The minimum priority for rules to load.

Default value5Details
Type
integer
Propertyprotectedstring  $rulesets= 'codesize,unusedcode'

The rule-set filenames or identifier.

Default valuecodesize,unusedcodeDetails
Type
string

Methods

methodpublic  createFileSet( ) : \FileSet
Nested creator, adds a set of files (nested fileset attribute).
Returns
Type Description
\FileSet
methodpublic  createFormatter( ) : \PHPMDFormatterElement
Create object for nested formatter element.
Returns
Type Description
\PHPMDFormatterElement
methodpublic  init( ) :
Load the necessary environment for running PHPMD.
Details
throws
- if the phpmd classes can't be loaded.
methodpublic  main( ) : void
Executes PHPMD against PhingFile or a FileSet
methodpublic  setAllowedFileExtensions( string $fileExtensions ) : void
Sets a list of filename extensions for valid php source code files.
Parameters
Name Type Description
$fileExtensions string List of valid file extensions without leading dot.
methodpublic  setFile( \PhingFile $file ) : void
Set the input source file or directory.
Parameters
Name Type Description
$file \PhingFile The input source file or directory.
methodpublic  setIgnorePatterns( string $ignorePatterns ) : void
Sets a list of ignore patterns that is used to exclude directories from the source analysis.
Parameters
Name Type Description
$ignorePatterns string List of ignore patterns.
methodpublic  setMinimumPriority( integer $minimumPriority ) : void
Sets the minimum rule priority.
Parameters
Name Type Description
$minimumPriority integer Minimum rule priority.
methodpublic  setRulesets( string $ruleSetFileNames ) : void
Sets the rule-sets.
Parameters
Name Type Description
$ruleSetFileNames string

Comma-separated string of rule-set filenames or identifier.

Documentation was generated by DocBlox 0.13.1.