<?php preg_replace( string|array $pattern, string|array $replacement, string|array $subject, int $limit = -1, int &$count = null): string|array|null
<?php protected function formatPath(string $path): string { return preg_replace('/(?:\/)+$/u', '', $path).'/'; } }
<?php protected function trimEmptyLines(string $value) { $value = preg_replace('/^\|---LINE:([0-9]+)---\|$/m', '', $value); return ltrim($value, PHP_EOL); }