You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deprecated: ZipArchive::open(): Passing null to parameter #2 ($flags) of type int is deprecated in /var/itrans/one/app/Vendor/phpoffice/phpword/src/PhpWord/Shared/ZipArchive.php on line 136
The current method signature of ZipArchive::open() is public function open($filename, $flags = null).
If no argument is passed as the second argument here, null is passed as the second argument on line 136:
$zip = new \ZipArchive();
$result = $zip->open($this->filename, $flags); // <-- line 136
Passing 0 achieves the same behaviour as passing null. Therefore, I believe the appropriate fix here would be:
$zip = new \ZipArchive();
if ($flags === null) {
$flags = 0;
}
$result = $zip->open($this->filename, $flags);
This would eliminate the deprecation and not break any BC within the library.
I'm happy to submit a PR if required.
The text was updated successfully, but these errors were encountered:
The current method signature of
ZipArchive::open()
ispublic function open($filename, $flags = null)
.If no argument is passed as the second argument here,
null
is passed as the second argument on line 136:Passing
0
achieves the same behaviour as passingnull
. Therefore, I believe the appropriate fix here would be:This would eliminate the deprecation and not break any BC within the library.
I'm happy to submit a PR if required.
The text was updated successfully, but these errors were encountered: