Swift_StreamFilters_StringReplacementFilter
in package
implements
Swift_StreamFilter
Processes bytes as they pass through a buffer and replaces sequences in it.
Tags
Interfaces, Classes and Traits
- Swift_StreamFilter
- Processes bytes as they pass through a stream and performs filtering.
Table of Contents
- $replace : mixed
- The replacement(s) to make
- $search : mixed
- The needle(s) to search for
- __construct() : mixed
- Create a new StringReplacementFilter with $search and $replace.
- filter() : string
- Perform the actual replacements on $buffer and return the result.
- shouldBuffer() : bool
- Returns true if based on the buffer passed more bytes should be buffered.
Properties
$replace
The replacement(s) to make
private
mixed
$replace
$search
The needle(s) to search for
private
mixed
$search
Methods
__construct()
Create a new StringReplacementFilter with $search and $replace.
public
__construct(string|array<string|int, mixed> $search, string|array<string|int, mixed> $replace) : mixed
Parameters
- $search : string|array<string|int, mixed>
- $replace : string|array<string|int, mixed>
Return values
mixed —filter()
Perform the actual replacements on $buffer and return the result.
public
filter(string $buffer) : string
Parameters
- $buffer : string
Return values
string —shouldBuffer()
Returns true if based on the buffer passed more bytes should be buffered.
public
shouldBuffer(string $buffer) : bool
Parameters
- $buffer : string