Code improvements (#1649)
* use global namespace for faster lookups * phpstan level 5
This commit is contained in:
@@ -37,15 +37,15 @@ class MPdfConverter implements HtmlToPdfConverter
|
||||
|
||||
// some OS do not follow the PHP default settings
|
||||
if ((int) ini_get('pcre.backtrack_limit') < 1000000) {
|
||||
@ini_set('pcre.backtrack_limit', 1000000);
|
||||
@ini_set('pcre.backtrack_limit', '1000000');
|
||||
}
|
||||
|
||||
// reduce the size of content parts that are passed to MPDF, to prevent
|
||||
// https://mpdf.github.io/troubleshooting/known-issues.html#blank-pages-or-some-sections-missing
|
||||
$parts = explode('<pagebreak>', $html);
|
||||
for ($i = 0; $i < count($parts); $i++) {
|
||||
for ($i = 0; $i < \count($parts); $i++) {
|
||||
$mpdf->WriteHTML($parts[$i]);
|
||||
if ($i < count($parts) - 1) {
|
||||
if ($i < \count($parts) - 1) {
|
||||
$mpdf->WriteHTML('<pagebreak>');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user