# classes/phing/filters/PrefixLines.php

## \PrefixLines
jump to top

Attaches a prefix to every line.

Example:

Or:

Extends from
  \BaseParamFilterReader
Implements
  \ChainableReader
see
  \FilterReader
access
  public
author
  Yannick Lecaillez
author
  hans lellelid, hans@velum.net
copyright
  © 2003 seasonfive. All rights reserved
package
  phing.filters
version
  $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

### Constants

`string PREFIX_KEY = 'lines'`

Parameter name for the prefix.

  string

### Properties

`string $_prefix= 'null'`

The prefix to be used.

Default value `null` Details

Type
  string

### Methods

`_initialize( ) :`
Initializes the prefix if it is available from the parameters.
`chain( object $reader ) : object`
Creates a new PrefixLines filter using the passed in Reader for instantiation.
Parameters

Name | Type | Description
--- | --- | ---
$reader | object | A Reader object providing the underlying stream. Must not be `null`.

Returns

Type | Description
--- | ---
object |

`getPrefix( ) : string`
Returns the prefix which will be added at the start of each input line.
Returns

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

`read( $len = null ) : mixed`
Adds a prefix to each line of input stream and returns resulting stream.
Parameters

Name | Type | Description
--- | --- | ---
$len |  |

Returns

Type | Description
--- | ---
mixed |

`setPrefix( string $prefix ) :`
Sets the prefix to add at the start of each input line.
Parameters

Name | Type | Description
--- | --- | ---
$prefix | string | The prefix to add at the start of each input line. May be `null`, in which case no prefix is added.

Documentation was generated by DocBlox 0.13.1.