@@ 1180-1190 (lines=11) @@ | ||
1177 | * |
|
1178 | * @throws InvalidArgumentException |
|
1179 | */ |
|
1180 | public static function unicodeLetters($value, $message = '') |
|
1181 | { |
|
1182 | static::string($value); |
|
1183 | ||
1184 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
1185 | static::reportInvalidArgument(\sprintf( |
|
1186 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
1187 | static::valueToString($value) |
|
1188 | )); |
|
1189 | } |
|
1190 | } |
|
1191 | ||
1192 | /** |
|
1193 | * @psalm-pure |
|
@@ 1409-1419 (lines=11) @@ | ||
1406 | * |
|
1407 | * @throws InvalidArgumentException |
|
1408 | */ |
|
1409 | public static function fileExists($value, $message = '') |
|
1410 | { |
|
1411 | static::string($value); |
|
1412 | ||
1413 | if (!\file_exists($value)) { |
|
1414 | static::reportInvalidArgument(\sprintf( |
|
1415 | $message ?: 'The file %s does not exist.', |
|
1416 | static::valueToString($value) |
|
1417 | )); |
|
1418 | } |
|
1419 | } |
|
1420 | ||
1421 | /** |
|
1422 | * @param mixed $value |