# classes/phing/filters/LineContains.php

## \Contains
jump to top

Holds a contains element.

package
  phing.filters

### Properties

`string $_value= ''`

Details

Type
  string

### Methods

`getValue( ) : string`
Returns 'contains' value.
Returns

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

`setValue( string $contains ) :`
Set 'contains' value.
Parameters

Name | Type | Description
--- | --- | ---
$contains | string |

## \LineContains
jump to top

Filter which includes only those lines that contain all the user-specified strings.

Example:

    <linecontains>

    </linecontains>

Or:

This will include only those lines that contain `foo` and `bar`.

Extends from
  \BaseParamFilterReader
Implements
  \ChainableReader
see
  \PhingFilterReader
author
  Yannick Lecaillez
author
  Hans Lellelid
copyright
  © 2003 seasonfive. All rights reserved
package
  phing.filters
version
  $Revision: 1084 $

### Constants

`string CONTAINS_KEY = 'contains'`

The parameter name for the string to match on.

  string

### Properties

`array $_contains= 'array'`

Array of Contains objects.

Default value `array` Details

Type
  array

`string $_line= 'null'`

[Deprecated]

Default value `null` Details

Type
  string

### Methods

`_initialize( ) :`
Parses the parameters to add user-defined contains strings.
`chain( object $reader ) : object`
Creates a new LineContains 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 |

`createContains( ) : \Contains`
Adds a `contains` nested element.
Returns

Type | Description
--- | ---
\Contains |

`getContains( ) : array`
Returns the vector of words which must be contained within a line read from the original stream in order for it to match this filter.
Returns

Type | Description
--- | ---
array |

`read( $len = null ) : mixed`
Returns all lines in a buffer that contain specified strings.
Parameters

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

Returns

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

`readChar( ) : \the`
[Deprecated. For reference only, used to be read() method.] Returns the next character in the filtered stream, only including lines from the original stream which contain all of the specified words.
Returns

Type | Description
--- | ---
\the |

Details

exception
  IOException if the underlying stream throws an IOException during reading

`setContains( array $contains ) :`
Sets the array of words which must be contained within a line read from the original stream in order for it to match this filter.
Parameters

Name | Type | Description
--- | --- | ---
$contains | array | An array of words which must be contained within a line in order for it to match in this filter. Must not be `null`.

Documentation was generated by DocBlox 0.13.1.