@@ 1198-1208 (lines=11) @@ | ||
1195 | * |
|
1196 | * @throws InvalidArgumentException |
|
1197 | */ |
|
1198 | public static function unicodeLetters($value, $message = '') |
|
1199 | { |
|
1200 | static::string($value); |
|
1201 | ||
1202 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
1203 | static::reportInvalidArgument(\sprintf( |
|
1204 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
1205 | static::valueToString($value) |
|
1206 | )); |
|
1207 | } |
|
1208 | } |
|
1209 | ||
1210 | /** |
|
1211 | * @psalm-pure |
|
@@ 1427-1437 (lines=11) @@ | ||
1424 | * |
|
1425 | * @throws InvalidArgumentException |
|
1426 | */ |
|
1427 | public static function fileExists($value, $message = '') |
|
1428 | { |
|
1429 | static::string($value); |
|
1430 | ||
1431 | if (!\file_exists($value)) { |
|
1432 | static::reportInvalidArgument(\sprintf( |
|
1433 | $message ?: 'The file %s does not exist.', |
|
1434 | static::valueToString($value) |
|
1435 | )); |
|
1436 | } |
|
1437 | } |
|
1438 | ||
1439 | /** |
|
1440 | * @param mixed $value |