diff --git a/src/Assert.php b/src/Assert.php index db1f3a5..c155bd1 100644 --- a/src/Assert.php +++ b/src/Assert.php @@ -1426,11 +1426,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) )); } @@ -1444,8 +1442,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.', @@ -1462,11 +1458,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) )); }