@@ 1149-1159 (lines=11) @@ | ||
1146 | * |
|
1147 | * @throws InvalidArgumentException |
|
1148 | */ |
|
1149 | public static function unicodeLetters($value, $message = '') |
|
1150 | { |
|
1151 | static::string($value); |
|
1152 | ||
1153 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
1154 | static::reportInvalidArgument(\sprintf( |
|
1155 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
1156 | static::valueToString($value) |
|
1157 | )); |
|
1158 | } |
|
1159 | } |
|
1160 | ||
1161 | /** |
|
1162 | * @psalm-assert string $value |
|
@@ 1360-1370 (lines=11) @@ | ||
1357 | * |
|
1358 | * @throws InvalidArgumentException |
|
1359 | */ |
|
1360 | public static function fileExists($value, $message = '') |
|
1361 | { |
|
1362 | static::string($value); |
|
1363 | ||
1364 | if (!\file_exists($value)) { |
|
1365 | static::reportInvalidArgument(\sprintf( |
|
1366 | $message ?: 'The file %s does not exist.', |
|
1367 | static::valueToString($value) |
|
1368 | )); |
|
1369 | } |
|
1370 | } |
|
1371 | ||
1372 | /** |
|
1373 | * @param mixed $value |