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