| @@ 1239-1249 (lines=11) @@ | ||
| 1236 | * |
|
| 1237 | * @throws InvalidArgumentException |
|
| 1238 | */ |
|
| 1239 | public static function unicodeLetters($value, $message = '') |
|
| 1240 | { |
|
| 1241 | static::string($value); |
|
| 1242 | ||
| 1243 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
| 1244 | static::reportInvalidArgument(\sprintf( |
|
| 1245 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
| 1246 | static::valueToString($value) |
|
| 1247 | )); |
|
| 1248 | } |
|
| 1249 | } |
|
| 1250 | ||
| 1251 | /** |
|
| 1252 | * @psalm-pure |
|
| @@ 1468-1478 (lines=11) @@ | ||
| 1465 | * |
|
| 1466 | * @throws InvalidArgumentException |
|
| 1467 | */ |
|
| 1468 | public static function fileExists($value, $message = '') |
|
| 1469 | { |
|
| 1470 | static::string($value); |
|
| 1471 | ||
| 1472 | if (!\file_exists($value)) { |
|
| 1473 | static::reportInvalidArgument(\sprintf( |
|
| 1474 | $message ?: 'The file %s does not exist.', |
|
| 1475 | static::valueToString($value) |
|
| 1476 | )); |
|
| 1477 | } |
|
| 1478 | } |
|
| 1479 | ||
| 1480 | /** |
|
| 1481 | * @param mixed $value |
|