@@ 1297-1307 (lines=11) @@ | ||
1294 | * |
|
1295 | * @throws InvalidArgumentException |
|
1296 | */ |
|
1297 | public static function unicodeLetters($value, $message = '') |
|
1298 | { |
|
1299 | static::string($value); |
|
1300 | ||
1301 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
1302 | static::reportInvalidArgument(\sprintf( |
|
1303 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
1304 | static::valueToString($value) |
|
1305 | )); |
|
1306 | } |
|
1307 | } |
|
1308 | ||
1309 | /** |
|
1310 | * @psalm-pure |
|
@@ 1526-1536 (lines=11) @@ | ||
1523 | * |
|
1524 | * @throws InvalidArgumentException |
|
1525 | */ |
|
1526 | public static function fileExists($value, $message = '') |
|
1527 | { |
|
1528 | static::string($value); |
|
1529 | ||
1530 | if (!\file_exists($value)) { |
|
1531 | static::reportInvalidArgument(\sprintf( |
|
1532 | $message ?: 'The file %s does not exist.', |
|
1533 | static::valueToString($value) |
|
1534 | )); |
|
1535 | } |
|
1536 | } |
|
1537 | ||
1538 | /** |
|
1539 | * @param mixed $value |