classes/phing/filters/ReplaceRegexp.php

\ReplaceRegexp

Performs a regexp find/replace on stream.

<

p> Example:


   
   

Extends from
\BaseFilterReader
Implements
\ChainableReader
author
Hans Lellelid
package
phing.filters
version
$Revision: 779 $

Properties

Propertyprivatearray  $regexps= 'array'

RegularExpression[]
Default valuearrayDetails
Type
array

Methods

methodpublic  chain( \Reader $reader ) : \ReplaceRegExp
Creates a new ReplaceRegExp filter using the passed in Reader for instantiation.
Parameters
Name Type Description
$reader \Reader

A Reader object providing the underlying stream. Must not be null.

Returns
Type Description
\ReplaceRegExp
methodpublic  createRegexp( ) : \RegularExpression
Creator method handles nested tags.
Returns
Type Description
\RegularExpression
methodpublic  getRegexps( ) : array
Gets the current regexps.

(Used when, e.g., cloning/chaining the method.)

Returns
Type Description
array
methodpublic  read( int $len = null ) : mixed
Returns the filtered stream.

The original stream is first read in fully, and the regex replace is performed.

Parameters
Name Type Description
$len int

Required $len for Reader compliance.

Returns
Type Description
mixed
Details
exception
IOException if the underlying stream throws an IOException during reading
methodpublic  setRegexps( array $regexps ) :
Sets the current regexps.

(Used when, e.g., cloning/chaining the method.)

Parameters
Name Type Description
$regexps array

RegularExpression[]

Documentation was generated by DocBlox 0.13.1.