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