ReplacementModel
class ReplacementModel (View source)
The Replacement model.
Properties
private | $regexFlags | The search regex flags. | |
private | $replaceValue | The replace value. | |
private | $searchValue | The search value. |
Methods
__construct(string $searchValue, string $replaceValue, bool $isRegex, bool $isCaseSensitive)
Initialize a new replacement model.
bool
replaceInFiles(array $fileKeysArray)
Replace matches with a given string in a given list of files.
array
replaceInBlocksRecursively(array $blocks)
Replace matches in block data recursively.
array
replaceInData(array $data, array $keys)
Replace matches in data for a given list of keys.
mixed
replaceInValueRecursively(array|object|string $value)
Replace searched string in a value that is either a string or an multidimensional array of strings.
Details
at line 77
__construct(string $searchValue, string $replaceValue, bool $isRegex, bool $isCaseSensitive)
Initialize a new replacement model.
at line 99
bool
replaceInFiles(array $fileKeysArray)
Replace matches with a given string in a given list of files.
at line 123
private array
replaceInBlocksRecursively(array $blocks)
Replace matches in block data recursively.
at line 144
private array
replaceInData(array $data, array $keys)
Replace matches in data for a given list of keys.
at line 173
private mixed
replaceInValueRecursively(array|object|string $value)
Replace searched string in a value that is either a string or an multidimensional array of strings.