fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class CheckedPattern
|
||||
{
|
||||
/** @return list<string> */
|
||||
public static function split(string $pattern, string $value): array
|
||||
{
|
||||
$parts = preg_split($pattern, $value);
|
||||
if ($parts === false) {
|
||||
throw new RuntimeException('Text could not be split; original content has been preserved.');
|
||||
}
|
||||
|
||||
return $parts;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user