@@ 1127-1137 (lines=11) @@ | ||
1124 | * |
|
1125 | * @throws InvalidArgumentException |
|
1126 | */ |
|
1127 | public static function unicodeLetters($value, $message = '') |
|
1128 | { |
|
1129 | static::string($value); |
|
1130 | ||
1131 | if (!\preg_match('/^\p{L}+$/u', $value)) { |
|
1132 | static::reportInvalidArgument(\sprintf( |
|
1133 | $message ?: 'Expected a value to contain only Unicode letters. Got: %s', |
|
1134 | static::valueToString($value) |
|
1135 | )); |
|
1136 | } |
|
1137 | } |
|
1138 | ||
1139 | /** |
|
1140 | * @param mixed $value |
|
@@ 1336-1346 (lines=11) @@ | ||
1333 | * |
|
1334 | * @throws InvalidArgumentException |
|
1335 | */ |
|
1336 | public static function fileExists($value, $message = '') |
|
1337 | { |
|
1338 | static::string($value); |
|
1339 | ||
1340 | if (!\file_exists($value)) { |
|
1341 | static::reportInvalidArgument(\sprintf( |
|
1342 | $message ?: 'The file %s does not exist.', |
|
1343 | static::valueToString($value) |
|
1344 | )); |
|
1345 | } |
|
1346 | } |
|
1347 | ||
1348 | /** |
|
1349 | * @param mixed $value |