@@ 1276-1286 (lines=11) @@ | ||
1273 | * @param mixed $value |
|
1274 | * @param string $message |
|
1275 | */ |
|
1276 | public static function file($value, $message = '') |
|
1277 | { |
|
1278 | static::fileExists($value, $message); |
|
1279 | ||
1280 | if (!\is_file($value)) { |
|
1281 | static::reportInvalidArgument(\sprintf( |
|
1282 | $message ?: 'The path %s is not a file.', |
|
1283 | static::valueToString($value) |
|
1284 | )); |
|
1285 | } |
|
1286 | } |
|
1287 | ||
1288 | /** |
|
1289 | * @param mixed $value |
|
@@ 1292-1302 (lines=11) @@ | ||
1289 | * @param mixed $value |
|
1290 | * @param string $message |
|
1291 | */ |
|
1292 | public static function directory($value, $message = '') |
|
1293 | { |
|
1294 | static::fileExists($value, $message); |
|
1295 | ||
1296 | if (!\is_dir($value)) { |
|
1297 | static::reportInvalidArgument(\sprintf( |
|
1298 | $message ?: 'The path %s is no directory.', |
|
1299 | static::valueToString($value) |
|
1300 | )); |
|
1301 | } |
|
1302 | } |
|
1303 | ||
1304 | /** |
|
1305 | * @param mixed $value |