File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -1250,11 +1250,6 @@ parameters:
1250
1250
count : 2
1251
1251
path : src/PhpSpreadsheet/DefinedName.php
1252
1252
1253
- -
1254
- message : " #^Cannot use array destructuring on array\\ |null\\ .$#"
1255
- count : 1
1256
- path : src/PhpSpreadsheet/Helper/Dimension.php
1257
-
1258
1253
-
1259
1254
message : " #^Cannot call method setBold\\ (\\ ) on PhpOffice\\\\ PhpSpreadsheet\\\\ Style\\\\ Font\\ |null\\ .$#"
1260
1255
count : 1
Original file line number Diff line number Diff line change @@ -57,8 +57,10 @@ class Dimension
57
57
58
58
public function __construct (string $ dimension )
59
59
{
60
+ // @phpstan-ignore-next-line
60
61
[$ size , $ unit ] = sscanf ($ dimension , '%[1234567890.]%s ' );
61
62
$ unit = strtolower (trim ($ unit ?? '' ));
63
+ $ size = (float ) $ size ;
62
64
63
65
// If a UoM is specified, then convert the size to pixels for internal storage
64
66
if (isset (self ::ABSOLUTE_UNITS [$ unit ])) {
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ private function cloneResource(): void
86
86
return ;
87
87
}
88
88
89
- $ width = imagesx ($ this ->imageResource );
90
- $ height = imagesy ($ this ->imageResource );
89
+ $ width = ( int ) imagesx ($ this ->imageResource );
90
+ $ height = ( int ) imagesy ($ this ->imageResource );
91
91
92
92
if (imageistruecolor ($ this ->imageResource )) {
93
93
$ clone = imagecreatetruecolor ($ width , $ height );
@@ -150,8 +150,8 @@ public function setImageResource($value)
150
150
151
151
if ($ this ->imageResource !== null ) {
152
152
// Get width/height
153
- $ this ->width = imagesx ($ this ->imageResource );
154
- $ this ->height = imagesy ($ this ->imageResource );
153
+ $ this ->width = ( int ) imagesx ($ this ->imageResource );
154
+ $ this ->height = ( int ) imagesy ($ this ->imageResource );
155
155
}
156
156
157
157
return $ this ;
You can’t perform that action at this time.
0 commit comments