Skip to content

Commit 6ba26ed

Browse files
committed
Fix test breaking
1 parent 22ec5d2 commit 6ba26ed

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Schema/Traits/Custom_Table_Query_Methods.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -843,19 +843,19 @@ public static function cast_value_based_on_type( string $type, $value ) {
843843
$instance = DateTime::class;
844844
}
845845

846-
$value = $instance::createFromFormat( 'Y-m-d H:i:s', $value );
846+
$new_value = $instance::createFromFormat( 'Y-m-d H:i:s', $value );
847847

848-
if ( $value instanceof DateTimeInterface ) {
849-
return $value;
848+
if ( $new_value instanceof DateTimeInterface ) {
849+
return $new_value;
850850
}
851851

852-
$value = $instance::createFromFormat( 'Y-m-d', $value );
852+
$new_value = $instance::createFromFormat( 'Y-m-d', $value );
853853

854-
if ( ! $value instanceof DateTimeInterface ) {
854+
if ( ! $new_value instanceof DateTimeInterface ) {
855855
throw new InvalidArgumentException( "Invalid datetime value format: {$value}." );
856856
}
857857

858-
return $value;
858+
return $new_value;
859859
default:
860860
throw new InvalidArgumentException( "Unsupported column type: {$type}." );
861861
}

0 commit comments

Comments
 (0)