@@ -44,43 +44,15 @@ public function save($filename, int $flags = 0): void
4444 $ orientation = ($ orientation == 'L ' ) ? 'landscape ' : 'portrait ' ;
4545
4646 // 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- }
5447 $ pdf = $ this ->createExternalWriterInstance ();
5548 $ pdf ->setPaper ($ paperSize , $ orientation );
5649
5750 $ pdf ->loadHtml ($ this ->generateHTMLAll ());
5851 $ pdf ->render ();
5952
6053 // Write to file
61- fwrite ($ fileHandle , $ pdf ->output () ?? '' );
54+ fwrite ($ fileHandle , $ pdf ->output ());
6255
63- if ($ restoreHandler ) {
64- restore_error_handler (); // @codeCoverageIgnore
65- }
6656 parent ::restoreStateAfterSave ();
6757 }
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- }
8658}
0 commit comments