-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A lot fo depreciated warrning on PHP 8 #49
Comments
Hi
Thanks for your detailed reply
I am updating most of the functions now
Still remains
*Deprecated function*: Function utf8_encode() is deprecated in
*PdfToText->__get_character_padding()* (line *5872* of
*modules/contrib/david/includes/pdfToText.inc*).
Many warnings about utf8_encode
Any chance you will add a php 8 version?
Regards
Carmel
…On Tue, 13 Aug 2024 at 08:33, camrionnvmff ***@***.***> wrote:
Mainly because PHP 8 has stricter requirements for the return types of
some interface methods. If a class implements certain interfaces (such as
ArrayAccess, Countable, etc.), the return type of the method must match the
interface definition.
resolvent
Update the return type of the method: You can add the correct return type
in the method of the class to comply with PHP 8 requirements. For example:
class PdfTexterCharacterMap implements ArrayAccess {
//Modify the offsetSet method
public function offsetSet($offset, $value): void {
//Method body
}
//Modify the offsetUnset method
public function offsetUnset($offset): void {
//Method body
}
}
Other methods such as offsetExists and offsetGet also require similar
modifications to ensure that their return types are consistent with the
interface definition.
Alternatively, you can use ServBay to redeploy the PHP8 environment, which
is more convenient to solve.
—
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BII7TVN5AEB6ABMTTS2IKTTZRGLBPAVCNFSM6AAAAABMLWGUK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBVGM3TCNZWGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
public function my_utf8_encode ($item){ Solved the utf8_encode deprecated problem |
I have fixes all the php 8.2 compatibility errors except this one: The class will still work with this error but will stop working in php 9. |
The original line is 1577 and the line is: |
Hello Christian
I am testing your excellent pdftotext php script.
It works great and I managed to process some pdf file that no other script managed to process.
However, I do get a lot of warnings like these:
Deprecated function: Return type of PdfTexterCharacterMap::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 7134 of modules/contrib/david/includes/PdfToText.inc).
Deprecated function: Return type of PdfTexterCharacterMap::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 7134 of modules/contrib/david/includes/PdfToText.inc).
Deprecated function: Return type of PdfTexterUnicodeMap::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 7191 of modules/contrib/david/includes/PdfToText.inc).
Deprecated function: Return type of PdfTexterUnicodeMap::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 7191 of modules/contrib/david/includes/PdfToText.inc).
Deprecated function: Return type of PdfTexterUnicodeMap::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 7191 of modules/contrib/david/includes/PdfToText.inc).
Deprecated function: Return type of PdfTexterEncodingMap::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 7487 of modules/contrib/david/includes/PdfToText.inc).
Deprecated function: Return type of PdfTexterEncodingMap::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 7487 of modules/contrib/david/includes/PdfToText.inc).
Deprecated function: Return type of PdfTexterEncodingMap::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 7487 of modules/contrib/david/includes/PdfToText.inc).
And many similar others...
I use php 8.2.4 under XAMPP
Will be grateful for any help
The text was updated successfully, but these errors were encountered: