| @@ 1447-1457 (lines=11) @@ | ||
| 1444 | * |
|
| 1445 | * @throws InvalidArgumentException |
|
| 1446 | */ |
|
| 1447 | public static function fileExists($value, $message = '') |
|
| 1448 | { |
|
| 1449 | static::string($value); |
|
| 1450 | ||
| 1451 | if (!\file_exists($value)) { |
|
| 1452 | static::reportInvalidArgument(\sprintf( |
|
| 1453 | $message ?: 'The file %s does not exist.', |
|
| 1454 | static::valueToString($value) |
|
| 1455 | )); |
|
| 1456 | } |
|
| 1457 | } |
|
| 1458 | ||
| 1459 | /** |
|
| 1460 | * @param mixed $value |
|
| @@ 1218-1228 (lines=11) @@ | ||
| 1215 | * |
|
| 1216 | * @throws InvalidArgumentException |
|
| 1217 | */ |
|
| 1218 | public static function unicodeLetters($value, $message = '') |
|
| 1219 | { |
|
| 1220 | static::string($value); |
|
| 1221 | ||
| 1222 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
| 1223 | static::reportInvalidArgument(\sprintf( |
|
| 1224 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
| 1225 | static::valueToString($value) |
|
| 1226 | )); |
|
| 1227 | } |
|
| 1228 | } |
|
| 1229 | ||
| 1230 | /** |
|
| 1231 | * @psalm-pure |
|