diff --git a/src/Assert.php b/src/Assert.php index 70a29c4..a427420 100644 --- a/src/Assert.php +++ b/src/Assert.php @@ -1467,11 +1467,9 @@ public static function lengthBetween($value, $min, $max, $message = '') */ public static function fileExists($value, $message = '') { - static::string($value); - if (!\file_exists($value)) { static::reportInvalidArgument(\sprintf( - $message ?: 'The file %s does not exist.', + $message ?: 'The path %s does not exist.', static::valueToString($value) )); } @@ -1485,8 +1483,6 @@ public static function fileExists($value, $message = '') */ public static function file($value, $message = '') { - static::fileExists($value, $message); - if (!\is_file($value)) { static::reportInvalidArgument(\sprintf( $message ?: 'The path %s is not a file.', @@ -1503,11 +1499,9 @@ public static function file($value, $message = '') */ public static function directory($value, $message = '') { - static::fileExists($value, $message); - if (!\is_dir($value)) { static::reportInvalidArgument(\sprintf( - $message ?: 'The path %s is no directory.', + $message ?: 'The path %s is not a directory.', static::valueToString($value) )); }