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