Documentation

StringReplacement
in package
implements FilterInterface

String replacement filter

Tags
category

Pop

author

Chris Corbyn, from the SwiftMailer library https://github.com/swiftmailer/swiftmailer

version
4.0.0

Table of Contents

Interfaces

FilterInterface
Stream filter interface

Properties

$replace  : string|array<string|int, mixed>
The replacement(s) to make
$search  : string|array<string|int, mixed>
The needle(s) to search for

Methods

__construct()  : mixed
Create a new StringReplacementFilter with $search and $replace
filter()  : mixed
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 string|array<string|int, mixed> $replace

The needle(s) to search for

private string|array<string|int, 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>

filter()

Perform the actual replacements on $buffer and return the result

public filter(mixed $buffer) : mixed
Parameters
$buffer : mixed

shouldBuffer()

Returns true if based on the buffer passed more bytes should be buffered

public shouldBuffer(mixed $buffer) : bool
Parameters
$buffer : mixed
Return values
bool

        
On this page

Search results