Code improvements (#1649)

* use global namespace for faster lookups
* phpstan level 5
This commit is contained in:
Kevin Papst
2020-04-19 14:37:14 +02:00
committed by GitHub
parent 7b25e9acaf
commit 0f3fa8fdbe
183 changed files with 604 additions and 574 deletions

View File

@@ -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>');
}
}