@@ 1229-1239 (lines=11) @@ | ||
1226 | * @param mixed $value |
|
1227 | * @param string $message |
|
1228 | */ |
|
1229 | public static function file($value, $message = '') |
|
1230 | { |
|
1231 | static::fileExists($value, $message); |
|
1232 | ||
1233 | if (!\is_file($value)) { |
|
1234 | static::reportInvalidArgument(\sprintf( |
|
1235 | $message ?: 'The path %s is not a file.', |
|
1236 | static::valueToString($value) |
|
1237 | )); |
|
1238 | } |
|
1239 | } |
|
1240 | ||
1241 | /** |
|
1242 | * @param mixed $value |
|
@@ 1245-1255 (lines=11) @@ | ||
1242 | * @param mixed $value |
|
1243 | * @param string $message |
|
1244 | */ |
|
1245 | public static function directory($value, $message = '') |
|
1246 | { |
|
1247 | static::fileExists($value, $message); |
|
1248 | ||
1249 | if (!\is_dir($value)) { |
|
1250 | static::reportInvalidArgument(\sprintf( |
|
1251 | $message ?: 'The path %s is no directory.', |
|
1252 | static::valueToString($value) |
|
1253 | )); |
|
1254 | } |
|
1255 | } |
|
1256 | ||
1257 | /** |
|
1258 | * @param mixed $value |