@@ -45,8 +45,8 @@ private function castMysql(float|int|string $expression): string
4545 // float one, but it will be silently downsized to a float when stored in a table.
4646 return match ($ this ->type ) {
4747 'bigint ' , 'int ' => "cast( {$ expression } as signed) " ,
48- 'float ' , 'double ' => "(( {$ expression })*1.0) " ,
49- default => throw new RuntimeException ("Unknown cast type ' {$ this ->type }'. " ), // @phpstan-ignore match.unreachable
48+ 'float ' , 'double ' => "(( {$ expression })*1.0) " , // @phpstan-ignore match.alwaysTrue
49+ default => throw new RuntimeException ("Unknown cast type ' {$ this ->type }'. " ),
5050 };
5151 }
5252
@@ -56,17 +56,17 @@ private function castPgsql(float|int|string $expression): string
5656 'bigint ' => "cast( {$ expression } as bigint) " ,
5757 'float ' => "cast( {$ expression } as real) " ,
5858 'double ' => "cast( {$ expression } as double precision) " ,
59- 'int ' => "cast( {$ expression } as int) " ,
60- default => throw new RuntimeException ("Unknown cast type ' {$ this ->type }'. " ), // @phpstan-ignore match.unreachable
59+ 'int ' => "cast( {$ expression } as int) " , // @phpstan-ignore match.alwaysTrue
60+ default => throw new RuntimeException ("Unknown cast type ' {$ this ->type }'. " ),
6161 };
6262 }
6363
6464 private function castSqlite (float |int |string $ expression ): string
6565 {
6666 return match ($ this ->type ) {
6767 'bigint ' , 'int ' => "cast( {$ expression } as integer) " ,
68- 'float ' , 'double ' => "cast( {$ expression } as real) " ,
69- default => throw new RuntimeException ("Unknown cast type ' {$ this ->type }'. " ), // @phpstan-ignore match.unreachable
68+ 'float ' , 'double ' => "cast( {$ expression } as real) " , // @phpstan-ignore match.alwaysTrue
69+ default => throw new RuntimeException ("Unknown cast type ' {$ this ->type }'. " ),
7070 };
7171 }
7272
@@ -76,8 +76,8 @@ private function castSqlsrv(float|int|string $expression): string
7676 'bigint ' => "cast( {$ expression } as bigint) " ,
7777 'float ' => "cast( {$ expression } as float(24)) " ,
7878 'double ' => "cast( {$ expression } as float(53)) " ,
79- 'int ' => "(( {$ expression })*1) " ,
80- default => throw new RuntimeException ("Unknown cast type ' {$ this ->type }'. " ), // @phpstan-ignore match.unreachable
79+ 'int ' => "(( {$ expression })*1) " , // @phpstan-ignore match.alwaysTrue
80+ default => throw new RuntimeException ("Unknown cast type ' {$ this ->type }'. " ),
8181 };
8282 }
8383}
0 commit comments