| @@ 1402-1412 (lines=11) @@ | ||
| 1399 | * |
|
| 1400 | * @throws InvalidArgumentException |
|
| 1401 | */ |
|
| 1402 | public static function unicodeLetters($value, $message = '') |
|
| 1403 | { |
|
| 1404 | static::string($value); |
|
| 1405 | ||
| 1406 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
| 1407 | static::reportInvalidArgument(\sprintf( |
|
| 1408 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
| 1409 | static::valueToString($value) |
|
| 1410 | )); |
|
| 1411 | } |
|
| 1412 | } |
|
| 1413 | ||
| 1414 | /** |
|
| 1415 | * @psalm-pure |
|
| @@ 1631-1641 (lines=11) @@ | ||
| 1628 | * |
|
| 1629 | * @throws InvalidArgumentException |
|
| 1630 | */ |
|
| 1631 | public static function fileExists($value, $message = '') |
|
| 1632 | { |
|
| 1633 | static::string($value); |
|
| 1634 | ||
| 1635 | if (!\file_exists($value)) { |
|
| 1636 | static::reportInvalidArgument(\sprintf( |
|
| 1637 | $message ?: 'The file %s does not exist.', |
|
| 1638 | static::valueToString($value) |
|
| 1639 | )); |
|
| 1640 | } |
|
| 1641 | } |
|
| 1642 | ||
| 1643 | /** |
|
| 1644 | * @param mixed $value |
|