@@ 1216-1226 (lines=11) @@ | ||
1213 | * |
|
1214 | * @throws InvalidArgumentException |
|
1215 | */ |
|
1216 | public static function unicodeLetters($value, $message = '') |
|
1217 | { |
|
1218 | static::string($value); |
|
1219 | ||
1220 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
1221 | static::reportInvalidArgument(\sprintf( |
|
1222 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
1223 | static::valueToString($value) |
|
1224 | )); |
|
1225 | } |
|
1226 | } |
|
1227 | ||
1228 | /** |
|
1229 | * @param mixed $value |
|
@@ 1425-1435 (lines=11) @@ | ||
1422 | * |
|
1423 | * @throws InvalidArgumentException |
|
1424 | */ |
|
1425 | public static function fileExists($value, $message = '') |
|
1426 | { |
|
1427 | static::string($value); |
|
1428 | ||
1429 | if (!\file_exists($value)) { |
|
1430 | static::reportInvalidArgument(\sprintf( |
|
1431 | $message ?: 'The file %s does not exist.', |
|
1432 | static::valueToString($value) |
|
1433 | )); |
|
1434 | } |
|
1435 | } |
|
1436 | ||
1437 | /** |
|
1438 | * @param mixed $value |