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:
12501250 count : 2
12511251 path : src/PhpSpreadsheet/DefinedName.php
12521252
1253- -
1254- message : " #^Cannot use array destructuring on array\\ |null\\ .$#"
1255- count : 1
1256- path : src/PhpSpreadsheet/Helper/Dimension.php
1257-
12581253 -
12591254 message : " #^Cannot call method setBold\\ (\\ ) on PhpOffice\\\\ PhpSpreadsheet\\\\ Style\\\\ Font\\ |null\\ .$#"
12601255 count : 1
Original file line number Diff line number Diff line change @@ -57,8 +57,10 @@ class Dimension
5757
5858 public function __construct (string $ dimension )
5959 {
60+ // @phpstan-ignore-next-line
6061 [$ size , $ unit ] = sscanf ($ dimension , '%[1234567890.]%s ' );
6162 $ unit = strtolower (trim ($ unit ?? '' ));
63+ $ size = (float ) $ size ;
6264
6365 // If a UoM is specified, then convert the size to pixels for internal storage
6466 if (isset (self ::ABSOLUTE_UNITS [$ unit ])) {
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ private function cloneResource(): void
8686 return ;
8787 }
8888
89- $ width = imagesx ($ this ->imageResource );
90- $ height = imagesy ($ this ->imageResource );
89+ $ width = ( int ) imagesx ($ this ->imageResource );
90+ $ height = ( int ) imagesy ($ this ->imageResource );
9191
9292 if (imageistruecolor ($ this ->imageResource )) {
9393 $ clone = imagecreatetruecolor ($ width , $ height );
@@ -150,8 +150,8 @@ public function setImageResource($value)
150150
151151 if ($ this ->imageResource !== null ) {
152152 // 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 );
155155 }
156156
157157 return $ this ;
You can’t perform that action at this time.
0 commit comments