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