| @@ 1123-1133 (lines=11) @@ | ||
| 1120 | * |
|
| 1121 | * @throws InvalidArgumentException |
|
| 1122 | */ |
|
| 1123 | public static function unicodeLetters($value, $message = '') |
|
| 1124 | { |
|
| 1125 | static::string($value); |
|
| 1126 | ||
| 1127 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
| 1128 | static::reportInvalidArgument(\sprintf( |
|
| 1129 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
| 1130 | static::valueToString($value) |
|
| 1131 | )); |
|
| 1132 | } |
|
| 1133 | } |
|
| 1134 | ||
| 1135 | /** |
|
| 1136 | * @param mixed $value |
|
| @@ 1332-1342 (lines=11) @@ | ||
| 1329 | * |
|
| 1330 | * @throws InvalidArgumentException |
|
| 1331 | */ |
|
| 1332 | public static function fileExists($value, $message = '') |
|
| 1333 | { |
|
| 1334 | static::string($value); |
|
| 1335 | ||
| 1336 | if (!\file_exists($value)) { |
|
| 1337 | static::reportInvalidArgument(\sprintf( |
|
| 1338 | $message ?: 'The file %s does not exist.', |
|
| 1339 | static::valueToString($value) |
|
| 1340 | )); |
|
| 1341 | } |
|
| 1342 | } |
|
| 1343 | ||
| 1344 | /** |
|
| 1345 | * @param mixed $value |
|