| @@ 1362-1372 (lines=11) @@ | ||
| 1359 | * |
|
| 1360 | * @throws InvalidArgumentException |
|
| 1361 | */ |
|
| 1362 | public static function unicodeLetters($value, $message = '') |
|
| 1363 | { |
|
| 1364 | static::string($value); |
|
| 1365 | ||
| 1366 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
| 1367 | static::reportInvalidArgument(\sprintf( |
|
| 1368 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
| 1369 | static::valueToString($value) |
|
| 1370 | )); |
|
| 1371 | } |
|
| 1372 | } |
|
| 1373 | ||
| 1374 | /** |
|
| 1375 | * @psalm-pure |
|
| @@ 1591-1601 (lines=11) @@ | ||
| 1588 | * |
|
| 1589 | * @throws InvalidArgumentException |
|
| 1590 | */ |
|
| 1591 | public static function fileExists($value, $message = '') |
|
| 1592 | { |
|
| 1593 | static::string($value); |
|
| 1594 | ||
| 1595 | if (!\file_exists($value)) { |
|
| 1596 | static::reportInvalidArgument(\sprintf( |
|
| 1597 | $message ?: 'The file %s does not exist.', |
|
| 1598 | static::valueToString($value) |
|
| 1599 | )); |
|
| 1600 | } |
|
| 1601 | } |
|
| 1602 | ||
| 1603 | /** |
|
| 1604 | * @param mixed $value |
|