@@ -44,43 +44,15 @@ public function save($filename, int $flags = 0): void
44
44
$ orientation = ($ orientation == 'L ' ) ? 'landscape ' : 'portrait ' ;
45
45
46
46
// Create PDF
47
- $ restoreHandler = false ;
48
- if (PHP_VERSION_ID >= self ::$ temporaryVersionCheck ) {
49
- // @codeCoverageIgnoreStart
50
- set_error_handler (self ::specialErrorHandler (...));
51
- $ restoreHandler = true ;
52
- // @codeCoverageIgnoreEnd
53
- }
54
47
$ pdf = $ this ->createExternalWriterInstance ();
55
48
$ pdf ->setPaper ($ paperSize , $ orientation );
56
49
57
50
$ pdf ->loadHtml ($ this ->generateHTMLAll ());
58
51
$ pdf ->render ();
59
52
60
53
// Write to file
61
- fwrite ($ fileHandle , $ pdf ->output () ?? '' );
54
+ fwrite ($ fileHandle , $ pdf ->output ());
62
55
63
- if ($ restoreHandler ) {
64
- restore_error_handler (); // @codeCoverageIgnore
65
- }
66
56
parent ::restoreStateAfterSave ();
67
57
}
68
-
69
- protected static int $ temporaryVersionCheck = 80500 ;
70
-
71
- /**
72
- * Temporary handler for Php8.5 waiting for Dompdf release.
73
- *
74
- * @codeCoverageIgnore
75
- */
76
- public function specialErrorHandler (int $ errno , string $ errstr , string $ filename , int $ lineno ): bool
77
- {
78
- if ($ errno === E_DEPRECATED ) {
79
- if (preg_match ('/canonical|imagedestroy|http_get_last_response_headers|Using null as an array offset/ ' , $ errstr ) === 1 ) {
80
- return true ;
81
- }
82
- }
83
-
84
- return false ; // continue error handling
85
- }
86
58
}
0 commit comments