Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public static function nonEmptyArray(mixed $value, ?string $message = null): arr
*/
public static function nonEmptyString(mixed $value, ?string $message = null): string
{
Assert::string($value);
Assert::string($value, $message);

if (strlen($value) === 0) {
throw ExceptionFactory::createException('a non empty string', $value, $message);
Expand Down Expand Up @@ -707,7 +707,7 @@ public static function lessThan(mixed $left, mixed $right, ?string $message = nu
*/
public static function fileExists(mixed $value, ?string $message = null): string|Stringable
{
static::stringable($value);
static::stringable($value, $message);
if (file_exists((string)$value) === false) {
throw ExceptionFactory::createException('a file or directory that exists', $value, $message);
}
Expand All @@ -721,7 +721,7 @@ public static function fileExists(mixed $value, ?string $message = null): string
*/
public static function file(mixed $value, ?string $message = null): string|Stringable
{
static::fileExists($value);
static::fileExists($value, $message);
if (is_file((string)$value) === false) {
throw ExceptionFactory::createException('a file', $value, $message);
}
Expand All @@ -735,7 +735,7 @@ public static function file(mixed $value, ?string $message = null): string|Strin
*/
public static function directory(mixed $value, ?string $message = null): string|Stringable
{
static::fileExists($value);
static::fileExists($value, $message);
if (is_dir((string)$value) === false) {
throw ExceptionFactory::createException('a directory', $value, $message);
}
Expand All @@ -749,7 +749,7 @@ public static function directory(mixed $value, ?string $message = null): string|
*/
public static function readable(mixed $value, ?string $message = null): string|Stringable
{
static::stringable($value);
static::stringable($value, $message);
if (is_readable((string)$value) === false) {
throw ExceptionFactory::createException('readable', $value, $message);
}
Expand All @@ -763,7 +763,7 @@ public static function readable(mixed $value, ?string $message = null): string|S
*/
public static function writable(mixed $value, ?string $message = null): string|Stringable
{
static::stringable($value);
static::stringable($value, $message);
if (is_writable((string)$value) === false) {
throw ExceptionFactory::createException('writable', $value, $message);
}
Expand Down
Loading