From 0d9c11c99a1793a61ae39c9a2cab4174f52c090f Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 14 Feb 2023 08:56:56 +0000 Subject: [PATCH] feat: prefixes evaluables --- src/Support/Str.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Support/Str.php b/src/Support/Str.php index 16145898..9ed75c1f 100644 --- a/src/Support/Str.php +++ b/src/Support/Str.php @@ -15,6 +15,11 @@ final class Str */ private const POOL = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + /** + * @var string + */ + private const PREFIX = '__pest_evaluable_'; + /** * Create a (unsecure & non-cryptographically safe) random alpha-numeric * string value. @@ -54,7 +59,7 @@ final class Str */ public static function evaluable(string $code): string { - $code = str_replace(' ', '_', $code); + $code = self::PREFIX.str_replace(' ', '_', $code); return (string) preg_replace('/[^A-Z_a-z0-9]/', '_', $code); }