Skip to content

Commit 641b6d0

Browse files
authored
Improve Coverage for Shared/Font (#2961)
Shared/Font is hardly covered in unit tests (as opposed to Style/Font which is completely covered). And it presented some good opportunities for code optimization. I wrote and tested the new unit tests first, then optimized the code and confirmed that everything still works. There is still a bit of a gap with "exact" measurements. I had tests ready, but had to withdraw them when I discovered they weren't quite portable (see php/php-src#9073).
1 parent 39df9c3 commit 641b6d0

File tree

5 files changed

+419
-377
lines changed

5 files changed

+419
-377
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,51 +2270,6 @@ parameters:
22702270
count: 1
22712271
path: src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php
22722272

2273-
-
2274-
message: "#^Cannot access offset 0 on array\\|false\\.$#"
2275-
count: 1
2276-
path: src/PhpSpreadsheet/Shared/Font.php
2277-
2278-
-
2279-
message: "#^Cannot access offset 2 on array\\|false\\.$#"
2280-
count: 1
2281-
path: src/PhpSpreadsheet/Shared/Font.php
2282-
2283-
-
2284-
message: "#^Cannot access offset 4 on array\\|false\\.$#"
2285-
count: 1
2286-
path: src/PhpSpreadsheet/Shared/Font.php
2287-
2288-
-
2289-
message: "#^Cannot access offset 6 on array\\|false\\.$#"
2290-
count: 1
2291-
path: src/PhpSpreadsheet/Shared/Font.php
2292-
2293-
-
2294-
message: "#^Parameter \\#1 \\$size of function imagettfbbox expects float, float\\|null given\\.$#"
2295-
count: 1
2296-
path: src/PhpSpreadsheet/Shared/Font.php
2297-
2298-
-
2299-
message: "#^Parameter \\#2 \\$defaultFont of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Drawing\\:\\:pixelsToCellDimension\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font, PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null given\\.$#"
2300-
count: 1
2301-
path: src/PhpSpreadsheet/Shared/Font.php
2302-
2303-
-
2304-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Font\\:\\:\\$autoSizeMethods has no type specified\\.$#"
2305-
count: 1
2306-
path: src/PhpSpreadsheet/Shared/Font.php
2307-
2308-
-
2309-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
2310-
count: 1
2311-
path: src/PhpSpreadsheet/Shared/Font.php
2312-
2313-
-
2314-
message: "#^Variable \\$cellText on left side of \\?\\? always exists and is not nullable\\.$#"
2315-
count: 1
2316-
path: src/PhpSpreadsheet/Shared/Font.php
2317-
23182273
-
23192274
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\JAMA\\\\EigenvalueDecomposition\\:\\:\\$cdivi has no type specified\\.$#"
23202275
count: 1

0 commit comments

Comments
 (0)