@@ 1024-1034 (lines=11) @@ | ||
1021 | * @param mixed $value |
|
1022 | * @param string $message |
|
1023 | */ |
|
1024 | public static function unicodeLetters($value, $message = '') |
|
1025 | { |
|
1026 | static::string($value); |
|
1027 | ||
1028 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
1029 | static::reportInvalidArgument(\sprintf( |
|
1030 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
1031 | static::valueToString($value) |
|
1032 | )); |
|
1033 | } |
|
1034 | } |
|
1035 | ||
1036 | /** |
|
1037 | * @param mixed $value |
|
@@ 1211-1221 (lines=11) @@ | ||
1208 | * @param mixed $value |
|
1209 | * @param string $message |
|
1210 | */ |
|
1211 | public static function fileExists($value, $message = '') |
|
1212 | { |
|
1213 | static::string($value); |
|
1214 | ||
1215 | if (!\file_exists($value)) { |
|
1216 | static::reportInvalidArgument(\sprintf( |
|
1217 | $message ?: 'The file %s does not exist.', |
|
1218 | static::valueToString($value) |
|
1219 | )); |
|
1220 | } |
|
1221 | } |
|
1222 | ||
1223 | /** |
|
1224 | * @param mixed $value |