ByteArrayReplacement
in package
implements
FilterInterface
Byte array replacement filter class
Tags
Table of Contents
Interfaces
- FilterInterface
- Stream filter interface
Properties
- $index : array<string|int, mixed>
- The Index for searching
- $replace : array<string|int, mixed>
- The replacement(s) to make
- $repSize : array<string|int, mixed>
- Replace size
- $search : array<string|int, mixed>
- The needle(s) to search for
- $tree : array<string|int, mixed>
- The Search Tree
- $treeMaxLen : int
- Gives the size of the largest search
Methods
- __construct() : mixed
- Create a new ByteArrayReplacementFilter 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
$index
The Index for searching
private
array<string|int, mixed>
$index
= []
$replace
The replacement(s) to make
private
array<string|int, mixed>
$replace
= []
$repSize
Replace size
private
array<string|int, mixed>
$repSize
= []
$search
The needle(s) to search for
private
array<string|int, mixed>
$search
= []
$tree
The Search Tree
private
array<string|int, mixed>
$tree
= []
$treeMaxLen
Gives the size of the largest search
private
int
$treeMaxLen
= 0
Methods
__construct()
Create a new ByteArrayReplacementFilter with $search and $replace
public
__construct(array<string|int, mixed> $search, array<string|int, mixed> $replace) : mixed
Parameters
- $search : array<string|int, mixed>
- $replace : array<string|int, mixed>
filter()
Perform the actual replacements on $buffer and return the result
public
filter(mixed $buffer[, int $minReplaces = -1 ]) : mixed
Parameters
- $buffer : mixed
- $minReplaces : int = -1
shouldBuffer()
Returns true if based on the buffer passed more bytes should be buffered
public
shouldBuffer(mixed $buffer) : bool
Parameters
- $buffer : mixed