@@ 1240-1250 (lines=11) @@ | ||
1237 | * |
|
1238 | * @throws InvalidArgumentException |
|
1239 | */ |
|
1240 | public static function unicodeLetters($value, $message = '') |
|
1241 | { |
|
1242 | static::string($value); |
|
1243 | ||
1244 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
1245 | static::reportInvalidArgument(\sprintf( |
|
1246 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
1247 | static::valueToString($value) |
|
1248 | )); |
|
1249 | } |
|
1250 | } |
|
1251 | ||
1252 | /** |
|
1253 | * @psalm-pure |
|
@@ 1469-1479 (lines=11) @@ | ||
1466 | * |
|
1467 | * @throws InvalidArgumentException |
|
1468 | */ |
|
1469 | public static function fileExists($value, $message = '') |
|
1470 | { |
|
1471 | static::string($value); |
|
1472 | ||
1473 | if (!\file_exists($value)) { |
|
1474 | static::reportInvalidArgument(\sprintf( |
|
1475 | $message ?: 'The file %s does not exist.', |
|
1476 | static::valueToString($value) |
|
1477 | )); |
|
1478 | } |
|
1479 | } |
|
1480 | ||
1481 | /** |
|
1482 | * @param mixed $value |