| @@ 1343-1353 (lines=11) @@ | ||
| 1340 | * |
|
| 1341 | * @throws InvalidArgumentException |
|
| 1342 | */ |
|
| 1343 | public static function unicodeLetters($value, $message = '') |
|
| 1344 | { |
|
| 1345 | static::string($value); |
|
| 1346 | ||
| 1347 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
| 1348 | static::reportInvalidArgument(\sprintf( |
|
| 1349 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
| 1350 | static::valueToString($value) |
|
| 1351 | )); |
|
| 1352 | } |
|
| 1353 | } |
|
| 1354 | ||
| 1355 | /** |
|
| 1356 | * @psalm-pure |
|
| @@ 1572-1582 (lines=11) @@ | ||
| 1569 | * |
|
| 1570 | * @throws InvalidArgumentException |
|
| 1571 | */ |
|
| 1572 | public static function fileExists($value, $message = '') |
|
| 1573 | { |
|
| 1574 | static::string($value); |
|
| 1575 | ||
| 1576 | if (!\file_exists($value)) { |
|
| 1577 | static::reportInvalidArgument(\sprintf( |
|
| 1578 | $message ?: 'The file %s does not exist.', |
|
| 1579 | static::valueToString($value) |
|
| 1580 | )); |
|
| 1581 | } |
|
| 1582 | } |
|
| 1583 | ||
| 1584 | /** |
|
| 1585 | * @param mixed $value |
|