diff --git a/psalm.baseline.xml b/psalm.baseline.xml index 271a6a6b2e..170c7c2780 100644 --- a/psalm.baseline.xml +++ b/psalm.baseline.xml @@ -1,5 +1,5 @@ - + 0 @@ -142,6 +142,13 @@ [static::class, 'randomDigit'] + static function ($matches) { + // remove backslashes (that are not followed by another backslash) because they are escape characters + $match = preg_replace('/\\\(?!\\\)/', '', $matches[1]); + $randomElement = Base::randomElement(str_split($match)); + //[.] should not be a random character, but a literal . + return str_replace('.', '\.', $randomElement); + } \UnitEnum