classes/phing/tasks/ext/phpcpd/PHPCPDTask.php
\PHPCPDTask
Runs PHP Copy & Paste Detector. Checking PHP files for duplicated code.
Refactored original PhpCpdTask provided by Timo Haberkern timo.haberkern@fantastic-bits.de
- Extends from
- \Task
- author
- Benjamin Schultz
- copyright
- 2001,2002 THYRELL. All rights reserved
- package
- phing.tasks.ext.phpcpd
- version
- $Id: PHPCPDTask.php 1281 2011-08-18 19:23:20Z mrook $
Properties

array
$_allowedFileExtensions= 'array'
List of valid file extensions for analyzed files.
arrayDetails- Type
- array

\PhingFile
$_file= 'null'
A php source code filename or directory
nullDetails- Type
- \PhingFile

\array<FileSet>
$_filesets= 'array'
All fileset objects assigned to this task
arrayDetails- Type
- \array<FileSet>

\array<PHPCPDFormatterElement>
$_formatters= 'array'
Formatter elements.
arrayDetails- Type
- \array<PHPCPDFormatterElement>

array
$_ignorePatterns= 'array'
List of exclude directory patterns.
arrayDetails- Type
- array
Methods

createFileSet(
)
:
\FileSetNested creator, adds a set of files (nested fileset attribute).
| Type | Description |
|---|---|
| \FileSet |

createFormatter(
)
:
\PHPCPDFormatterElementCreate object for nested formatter element.
| Type | Description |
|---|---|
| \PHPCPDFormatterElement |

init(
)
:
Load the necessary environment for running PHPCPD.
- throws
- - if the phpcpd classes can't be loaded.

setAllowedFileExtensions(
string $fileExtensions
)
:
voidSets a list of filename extensions for valid php source code files.
| Name | Type | Description |
|---|---|---|
| $fileExtensions | string | List of valid file extensions. |

setFile(
\PhingFile $file
)
:
voidSet the input source file or directory.
| Name | Type | Description |
|---|---|---|
| $file | \PhingFile | The input source file or directory. |

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

setIgnorePatterns(
string $ignorePatterns
)
:
voidSets a list of ignore patterns that is used to exclude directories from
the source analysis.
| Name | Type | Description |
|---|---|---|
| $ignorePatterns | string | List of ignore patterns. |

setMinLines(
integer $minLines
)
:
voidSets the minimum number of identical lines (default: 5).
| Name | Type | Description |
|---|---|---|
| $minLines | integer | Minimum number of identical lines |

setMinTokens(
integer $minTokens
)
:
Sets the minimum number of identical tokens (default: 70).
| Name | Type | Description |
|---|---|---|
| $minTokens | integer | Minimum number of identical tokens |

setMinimumPriority(
integer $minimumPriority
)
:
voidSets the minimum rule priority.
| Name | Type | Description |
|---|---|---|
| $minimumPriority | integer | Minimum rule priority. |