| @@ 1313-1323 (lines=11) @@ | ||
| 1310 | * |
|
| 1311 | * @throws InvalidArgumentException |
|
| 1312 | */ |
|
| 1313 | public static function unicodeLetters($value, $message = '') |
|
| 1314 | { |
|
| 1315 | static::string($value); |
|
| 1316 | ||
| 1317 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
| 1318 | static::reportInvalidArgument(\sprintf( |
|
| 1319 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
| 1320 | static::valueToString($value) |
|
| 1321 | )); |
|
| 1322 | } |
|
| 1323 | } |
|
| 1324 | ||
| 1325 | /** |
|
| 1326 | * @psalm-pure |
|
| @@ 1542-1552 (lines=11) @@ | ||
| 1539 | * |
|
| 1540 | * @throws InvalidArgumentException |
|
| 1541 | */ |
|
| 1542 | public static function fileExists($value, $message = '') |
|
| 1543 | { |
|
| 1544 | static::string($value); |
|
| 1545 | ||
| 1546 | if (!\file_exists($value)) { |
|
| 1547 | static::reportInvalidArgument(\sprintf( |
|
| 1548 | $message ?: 'The file %s does not exist.', |
|
| 1549 | static::valueToString($value) |
|
| 1550 | )); |
|
| 1551 | } |
|
| 1552 | } |
|
| 1553 | ||
| 1554 | /** |
|
| 1555 | * @param mixed $value |
|