feat: reworks evalution of Test Case

This commit is contained in:
Nuno Maduro
2021-11-14 19:58:25 +00:00
parent cd34f0ba81
commit 4b213d63bd
26 changed files with 603 additions and 620 deletions

View File

@ -48,4 +48,14 @@ final class Str
return substr($target, -$length) === $search;
}
/**
* Makes the given string evaluable by an `eval`.
*/
public static function evaluable(string $code): string
{
$code = str_replace(' ', '_', $code);
return (string) preg_replace('/[^A-Z_a-z0-9\\\\]/', '', $code);
}
}