| @@ 1131-1141 (lines=11) @@ | ||
| 1128 | * |
|
| 1129 | * @throws InvalidArgumentException |
|
| 1130 | */ |
|
| 1131 | public static function unicodeLetters($value, $message = '') |
|
| 1132 | { |
|
| 1133 | static::string($value); |
|
| 1134 | ||
| 1135 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
| 1136 | static::reportInvalidArgument(\sprintf( |
|
| 1137 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
| 1138 | static::valueToString($value) |
|
| 1139 | )); |
|
| 1140 | } |
|
| 1141 | } |
|
| 1142 | ||
| 1143 | /** |
|
| 1144 | * @param mixed $value |
|
| @@ 1340-1350 (lines=11) @@ | ||
| 1337 | * |
|
| 1338 | * @throws InvalidArgumentException |
|
| 1339 | */ |
|
| 1340 | public static function fileExists($value, $message = '') |
|
| 1341 | { |
|
| 1342 | static::string($value); |
|
| 1343 | ||
| 1344 | if (!\file_exists($value)) { |
|
| 1345 | static::reportInvalidArgument(\sprintf( |
|
| 1346 | $message ?: 'The file %s does not exist.', |
|
| 1347 | static::valueToString($value) |
|
| 1348 | )); |
|
| 1349 | } |
|
| 1350 | } |
|
| 1351 | ||
| 1352 | /** |
|
| 1353 | * @param mixed $value |
|