# tasks/ext/phpmd/PHPMDFormatterElement.php

$Id: PHPMDFormatterElement.php 1394 2011-12-21 19:50:14Z mrook $

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals and is licensed under the LGPL. For more information please see http://phing.info.

## \PHPMDFormatterElement
jump to top

Package: phing\tasks\ext\phpmd

A wrapper for the implementations of PHPMDResultFormatter.

Author
  Benjamin Schultz
Since
  2.4.1
Version
  $Id: PHPMDFormatterElement.php 1394 2011-12-21 19:50:14Z mrook $

### Properties

`\PHPMDResultFormatter $formatter= 'null'`

Default value `null` Details

Type
  \PHPMDResultFormatter

`\PhingFile $outfile= 'null'`

Output file for formatter.

Default value `null` Details

Type
  \PhingFile

`string $type= '""'`

The type of the formatter.

Default value`""`Details

Type
  string

`boolean $useFile= 'true'`

Whether to use file (or write output to phing log).

Default value `true` Details

Type
  boolean

### Methods

`getOutfile( ) : \PhingFile`

Get the output file.

Returns

Type | Description
--- | ---
\PhingFile |

`getRenderer( ) : \PHP_PMD_AbstractRenderer`

Creates a report renderer instance based on the formatter type.

Returns

Type | Description
--- | ---
\PHP_PMD_AbstractRenderer |

Throws

Exception | Description
--- | ---
\BuildException | When the specified renderer does not exist.

`getType( ) : string`

Get the formatter type

Returns

Type | Description
--- | ---
string |

`getUseFile( ) : boolean`

Return whether to write formatter results to file or not.

Returns

Type | Description
--- | ---
boolean |

`setOutfile( \PhingFile $outfile ) : void`

Sets the output file for the formatter results.

Parameters

Name | Type | Description
--- | --- | ---
$outfile | \PhingFile | The output file

`setType( string $type ) : void`

Sets the formatter type.

Parameters

Name | Type | Description
--- | --- | ---
$type | string | Type of the formatter

`setUseFile( boolean $useFile ) : void`

Set whether to write formatter results to file or not.

Parameters

Name | Type | Description
--- | --- | ---
$useFile | boolean | True or false.

Documentation was generated by DocBlox 0.17.1.