final class LiteralMask

Replaces quoted and code literals with filler so their words are not read as clauses.

Double quotes, single quotes and backticks open a literal; an apostrophe after a letter or digit is part of a word. Every masked character becomes "x", so the length is kept.

Methods§

public function apply(string $text): string

Masks every literal in a statement.

Parameters

$textstringThe statement

Returns

string The statement with literal characters replaced by "x"

Throws

InvalidInputException When a literal is not closed
Test cases 2
Called from 1
Calls 4

Test cases 18§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 16

Relations§

Instantiated in 1
Method calls 1