@@ -88,7 +88,7 @@ public function testSaveLoadWithDrawingInComment(): void
8888 $ sheet = $ spreadsheet ->getActiveSheet ();
8989 $ comment = $ sheet ->getComment ('A1 ' );
9090
91- self ::assertTrue ( $ comment instanceof Comment );
91+ self ::assertInstanceOf (Comment::class, $ comment );
9292 self ::assertTrue ($ comment ->hasBackgroundImage ());
9393 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
9494 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 178 );
@@ -127,7 +127,7 @@ public function testDrawingInCommentImageFormatsConversions(): void
127127 $ comment ->setSizeAsBackgroundImage ();
128128 self ::assertEquals ($ comment ->getWidth (), '112.5pt ' );
129129 self ::assertEquals ($ comment ->getHeight (), '112.5pt ' );
130- self ::assertTrue ( $ comment instanceof Comment );
130+ self ::assertInstanceOf (Comment::class, $ comment );
131131 self ::assertTrue ($ comment ->hasBackgroundImage ());
132132 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
133133 self ::assertEquals ($ comment ->getBackgroundImage ()->getType (), IMAGETYPE_GIF );
@@ -144,7 +144,7 @@ public function testDrawingInCommentImageFormatsConversions(): void
144144 $ comment ->setSizeAsBackgroundImage ();
145145 self ::assertEquals ($ comment ->getWidth (), '52.5pt ' );
146146 self ::assertEquals ($ comment ->getHeight (), '52.5pt ' );
147- self ::assertTrue ( $ comment instanceof Comment );
147+ self ::assertInstanceOf (Comment::class, $ comment );
148148 self ::assertTrue ($ comment ->hasBackgroundImage ());
149149 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
150150 self ::assertEquals ($ comment ->getBackgroundImage ()->getType (), IMAGETYPE_BMP );
@@ -162,7 +162,7 @@ public function testDrawingInCommentImageFormatsConversions(): void
162162 $ comment = $ sheet ->getComment ('A1 ' );
163163 self ::assertEquals ($ comment ->getWidth (), '112.5pt ' );
164164 self ::assertEquals ($ comment ->getHeight (), '112.5pt ' );
165- self ::assertTrue ( $ comment instanceof Comment );
165+ self ::assertInstanceOf (Comment::class, $ comment );
166166 self ::assertTrue ($ comment ->hasBackgroundImage ());
167167 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
168168 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 150 );
@@ -173,7 +173,7 @@ public function testDrawingInCommentImageFormatsConversions(): void
173173 $ comment = $ sheet ->getComment ('A2 ' );
174174 self ::assertEquals ($ comment ->getWidth (), '52.5pt ' );
175175 self ::assertEquals ($ comment ->getHeight (), '52.5pt ' );
176- self ::assertTrue ( $ comment instanceof Comment );
176+ self ::assertInstanceOf (Comment::class, $ comment );
177177 self ::assertTrue ($ comment ->hasBackgroundImage ());
178178 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
179179 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 70 );
@@ -208,7 +208,7 @@ public function testBuildWithDifferentImageFormats(): void
208208 self ::assertEquals ($ comment ->getHeight (), '75pt ' );
209209
210210 $ comment = $ sheet ->getComment ('A1 ' );
211- self ::assertTrue ( $ comment instanceof Comment );
211+ self ::assertInstanceOf (Comment::class, $ comment );
212212 self ::assertTrue ($ comment ->hasBackgroundImage ());
213213 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
214214 self ::assertEquals ($ comment ->getBackgroundImage ()->getType (), IMAGETYPE_PNG );
@@ -227,7 +227,7 @@ public function testBuildWithDifferentImageFormats(): void
227227 self ::assertEquals ($ comment ->getHeight (), '112.5pt ' );
228228
229229 $ comment = $ sheet ->getComment ('A2 ' );
230- self ::assertTrue ( $ comment instanceof Comment );
230+ self ::assertInstanceOf (Comment::class, $ comment );
231231 self ::assertTrue ($ comment ->hasBackgroundImage ());
232232 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
233233 self ::assertEquals ($ comment ->getBackgroundImage ()->getType (), IMAGETYPE_GIF );
@@ -246,7 +246,7 @@ public function testBuildWithDifferentImageFormats(): void
246246 self ::assertEquals ($ comment ->getHeight (), '37.5pt ' );
247247
248248 $ comment = $ sheet ->getComment ('A3 ' );
249- self ::assertTrue ( $ comment instanceof Comment );
249+ self ::assertInstanceOf (Comment::class, $ comment );
250250 self ::assertTrue ($ comment ->hasBackgroundImage ());
251251 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
252252 self ::assertEquals ($ comment ->getBackgroundImage ()->getType (), IMAGETYPE_JPEG );
@@ -265,7 +265,7 @@ public function testBuildWithDifferentImageFormats(): void
265265 self ::assertEquals ($ comment ->getHeight (), '52.5pt ' );
266266
267267 $ comment = $ sheet ->getComment ('A4 ' );
268- self ::assertTrue ( $ comment instanceof Comment );
268+ self ::assertInstanceOf (Comment::class, $ comment );
269269 self ::assertTrue ($ comment ->hasBackgroundImage ());
270270 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
271271 self ::assertEquals ($ comment ->getBackgroundImage ()->getType (), IMAGETYPE_BMP );
@@ -284,7 +284,7 @@ public function testBuildWithDifferentImageFormats(): void
284284 self ::assertEquals ($ comment ->getHeight (), '52.5pt ' );
285285
286286 $ comment = $ sheet ->getComment ('A5 ' );
287- self ::assertTrue ( $ comment instanceof Comment );
287+ self ::assertInstanceOf (Comment::class, $ comment );
288288 self ::assertTrue ($ comment ->hasBackgroundImage ());
289289 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
290290 self ::assertEquals ($ comment ->getBackgroundImage ()->getType (), IMAGETYPE_BMP );
@@ -304,7 +304,7 @@ public function testBuildWithDifferentImageFormats(): void
304304 self ::assertEquals ($ comment ->getHeight (), '52.5pt ' );
305305
306306 $ comment = $ sheet ->getComment ('A6 ' );
307- self ::assertTrue ( $ comment instanceof Comment );
307+ self ::assertInstanceOf (Comment::class, $ comment );
308308 self ::assertTrue ($ comment ->hasBackgroundImage ());
309309 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
310310 self ::assertEquals ($ comment ->getBackgroundImage ()->getType (), IMAGETYPE_BMP );
@@ -317,7 +317,7 @@ public function testBuildWithDifferentImageFormats(): void
317317 self ::assertStringContainsString ('purple_square.tiff ' , $ drawing ->getFilename ());
318318 self ::assertFalse ($ drawing ->getIsUrl ());
319319 $ comment = $ sheet ->getComment ('A7 ' );
320- self ::assertTrue ( $ comment instanceof Comment );
320+ self ::assertInstanceOf (Comment::class, $ comment );
321321 self ::assertFalse ($ comment ->hasBackgroundImage ());
322322 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
323323 self ::assertEquals ($ comment ->getBackgroundImage ()->getType (), IMAGETYPE_UNKNOWN );
@@ -326,39 +326,39 @@ public function testBuildWithDifferentImageFormats(): void
326326 $ comment ->setBackgroundImage ($ drawing );
327327 self ::fail ('Should throw exception when attempting to add tiff ' );
328328 } catch (PhpSpreadsheetException $ e ) {
329- self ::assertTrue ( $ e instanceof PhpSpreadsheetException );
329+ self ::assertInstanceOf (PhpSpreadsheetException::class, $ e );
330330 self ::assertEquals ($ e ->getMessage (), 'Unsupported image type in comment background. Supported types: PNG, JPEG, BMP, GIF. ' );
331331 }
332332
333333 try {
334334 $ drawing ->getImageTypeForSave ();
335335 self ::fail ('Should throw exception when attempting to get image type for tiff ' );
336336 } catch (PhpSpreadsheetException $ e ) {
337- self ::assertTrue ( $ e instanceof PhpSpreadsheetException );
337+ self ::assertInstanceOf (PhpSpreadsheetException::class, $ e );
338338 self ::assertEquals ($ e ->getMessage (), 'Unsupported image type in comment background. Supported types: PNG, JPEG, BMP, GIF. ' );
339339 }
340340
341341 try {
342342 $ drawing ->getMediaFilename ();
343343 self ::fail ('Should throw exception when attempting to get media file name for tiff ' );
344344 } catch (PhpSpreadsheetException $ e ) {
345- self ::assertTrue ( $ e instanceof PhpSpreadsheetException );
345+ self ::assertInstanceOf (PhpSpreadsheetException::class, $ e );
346346 self ::assertEquals ($ e ->getMessage (), 'Unsupported image type in comment background. Supported types: PNG, JPEG, BMP, GIF. ' );
347347 }
348348
349349 try {
350350 $ drawing ->getImageFileExtensionForSave ();
351351 self ::fail ('Should throw exception when attempting to get image file extention for tiff ' );
352352 } catch (PhpSpreadsheetException $ e ) {
353- self ::assertTrue ( $ e instanceof PhpSpreadsheetException );
353+ self ::assertInstanceOf (PhpSpreadsheetException::class, $ e );
354354 self ::assertEquals ($ e ->getMessage (), 'Unsupported image type in comment background. Supported types: PNG, JPEG, BMP, GIF. ' );
355355 }
356356
357357 try {
358358 $ drawing ->getImageMimeType ();
359359 self ::fail ('Should throw exception when attempting to get image mime type for tiff ' );
360360 } catch (PhpSpreadsheetException $ e ) {
361- self ::assertTrue ( $ e instanceof PhpSpreadsheetException );
361+ self ::assertInstanceOf (PhpSpreadsheetException::class, $ e );
362362 self ::assertEquals ($ e ->getMessage (), 'Unsupported image type in comment background. Supported types: PNG, JPEG, BMP, GIF. ' );
363363 }
364364
@@ -375,7 +375,7 @@ public function testBuildWithDifferentImageFormats(): void
375375 $ comment = $ sheet ->getComment ('A1 ' );
376376 self ::assertEquals ($ comment ->getWidth (), '75pt ' );
377377 self ::assertEquals ($ comment ->getHeight (), '75pt ' );
378- self ::assertTrue ( $ comment instanceof Comment );
378+ self ::assertInstanceOf (Comment::class, $ comment );
379379 self ::assertTrue ($ comment ->hasBackgroundImage ());
380380 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
381381 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 100 );
@@ -386,7 +386,7 @@ public function testBuildWithDifferentImageFormats(): void
386386 $ comment = $ sheet ->getComment ('A2 ' );
387387 self ::assertEquals ($ comment ->getWidth (), '112.5pt ' );
388388 self ::assertEquals ($ comment ->getHeight (), '112.5pt ' );
389- self ::assertTrue ( $ comment instanceof Comment );
389+ self ::assertInstanceOf (Comment::class, $ comment );
390390 self ::assertTrue ($ comment ->hasBackgroundImage ());
391391 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
392392 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 150 );
@@ -397,7 +397,7 @@ public function testBuildWithDifferentImageFormats(): void
397397 $ comment = $ sheet ->getComment ('A3 ' );
398398 self ::assertEquals ($ comment ->getWidth (), '37.5pt ' );
399399 self ::assertEquals ($ comment ->getHeight (), '37.5pt ' );
400- self ::assertTrue ( $ comment instanceof Comment );
400+ self ::assertInstanceOf (Comment::class, $ comment );
401401 self ::assertTrue ($ comment ->hasBackgroundImage ());
402402 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
403403 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 50 );
@@ -408,7 +408,7 @@ public function testBuildWithDifferentImageFormats(): void
408408 $ comment = $ sheet ->getComment ('A4 ' );
409409 self ::assertEquals ($ comment ->getWidth (), '52.5pt ' );
410410 self ::assertEquals ($ comment ->getHeight (), '52.5pt ' );
411- self ::assertTrue ( $ comment instanceof Comment );
411+ self ::assertInstanceOf (Comment::class, $ comment );
412412 self ::assertTrue ($ comment ->hasBackgroundImage ());
413413 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
414414 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 70 );
@@ -419,7 +419,7 @@ public function testBuildWithDifferentImageFormats(): void
419419 $ comment = $ sheet ->getComment ('A5 ' );
420420 self ::assertEquals ($ comment ->getWidth (), '52.5pt ' );
421421 self ::assertEquals ($ comment ->getHeight (), '52.5pt ' );
422- self ::assertTrue ( $ comment instanceof Comment );
422+ self ::assertInstanceOf (Comment::class, $ comment );
423423 self ::assertTrue ($ comment ->hasBackgroundImage ());
424424 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
425425 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 70 );
@@ -430,7 +430,7 @@ public function testBuildWithDifferentImageFormats(): void
430430 $ comment = $ sheet ->getComment ('A6 ' );
431431 self ::assertEquals ($ comment ->getWidth (), '52.5pt ' );
432432 self ::assertEquals ($ comment ->getHeight (), '52.5pt ' );
433- self ::assertTrue ( $ comment instanceof Comment );
433+ self ::assertInstanceOf (Comment::class, $ comment );
434434 self ::assertTrue ($ comment ->hasBackgroundImage ());
435435 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
436436 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 70 );
@@ -439,7 +439,7 @@ public function testBuildWithDifferentImageFormats(): void
439439
440440 // Check seventh image in comment background
441441 $ comment = $ sheet ->getComment ('A7 ' );
442- self ::assertTrue ( $ comment instanceof Comment );
442+ self ::assertInstanceOf (Comment::class, $ comment );
443443 self ::assertFalse ($ comment ->hasBackgroundImage ());
444444 self ::assertTrue ($ comment ->getBackgroundImage () instanceof Drawing);
445445 self ::assertEquals ($ comment ->getBackgroundImage ()->getWidth (), 0 );
0 commit comments