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