@@ 1315-1325 (lines=11) @@ | ||
1312 | * |
|
1313 | * @throws InvalidArgumentException |
|
1314 | */ |
|
1315 | public static function unicodeLetters($value, $message = '') |
|
1316 | { |
|
1317 | static::string($value); |
|
1318 | ||
1319 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
1320 | static::reportInvalidArgument(\sprintf( |
|
1321 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
1322 | static::valueToString($value) |
|
1323 | )); |
|
1324 | } |
|
1325 | } |
|
1326 | ||
1327 | /** |
|
1328 | * @psalm-pure |
|
@@ 1544-1554 (lines=11) @@ | ||
1541 | * |
|
1542 | * @throws InvalidArgumentException |
|
1543 | */ |
|
1544 | public static function fileExists($value, $message = '') |
|
1545 | { |
|
1546 | static::string($value); |
|
1547 | ||
1548 | if (!\file_exists($value)) { |
|
1549 | static::reportInvalidArgument(\sprintf( |
|
1550 | $message ?: 'The file %s does not exist.', |
|
1551 | static::valueToString($value) |
|
1552 | )); |
|
1553 | } |
|
1554 | } |
|
1555 | ||
1556 | /** |
|
1557 | * @param mixed $value |