scriptotek / php-marc

Simple interface for working with MARC records using the File_MARC package
MIT License
52 stars 11 forks source link

Problem with pear/File_MARC Extension and PHP 8.1 #25

Closed HagnMarkus closed 8 months ago

HagnMarkus commented 1 year ago

Using the very old and unmaintained code of pear/File_MARC (v1.4.1 / 2019-11-13) now causes a problem with PHP 8.1:

During inheritance of SplDoublyLinkedList: Uncaught ErrorException: Return type of File_MARC_List::key() should either be compatible with SplDoublyLinkedList::key(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in pear\file_marc\File\MARC\List.php:96

Perhaps the code of pear/File_MARC can be taken directly into the php-marc module and refactored?

HagnMarkus commented 1 year ago

They (pear/File_MARC) have customized it!! Maybe change composer to dev-master?

rudolfbyker commented 1 year ago

The PR that solves this is in the pear/File_MARC dependency is at https://github.com/pear/File_MARC/pull/19

sommer-gei commented 10 months ago

@rudolfbyker So, maybe you (I saw some commits by you in this repo) can change the required package in the composer.json in the main branch (, like @HagnMarkus suggested)?

from: "pear/file_marc": "^1.4.1" to: "pear/file_marc": "master@dev"

Currently I updated to PHP 8.3 and for me it seems impossible to use this fantastic library any longer. :(

BR

Update: I also saw that this project uses ck/file_marc_reference which IMHO don't seem to have code/a branch which is ready for PHP8. So it may a bit complicated situation here … :/

rudolfbyker commented 10 months ago

@sommer-gei I made PRs, but I did not merge. I don't think I have the access to do that. @danmichaelo performed the merges on all of my PRs.

danmichaelo commented 8 months ago

@rudolfbyker So, maybe you (I saw some commits by you in this repo) can change the required package in the composer.json in the main branch (, like @HagnMarkus suggested)?

from: "pear/file_marc": "^1.4.1" to: "pear/file_marc": "master@dev"

Currently I updated to PHP 8.3 and for me it seems impossible to use this fantastic library any longer. :(

BR

Update: I also saw that this project uses ck/file_marc_reference which IMHO don't seem to have code/a branch which is ready for PHP8. So it may a bit complicated situation here … :/

Sorry for my unresponsiveness, @HagnMarkus and @sommer-gei! I updated to "pear/file_marc": "@dev" now and published a new major version (3.0.0). While there are a lot of deprecation warnings from ck/file_marc_reference, it seems like the package continues to work fine from what I can see.

sommer-gei commented 7 months ago

@danmichaelo Thank you a lot for 3.0.0, it seems to work. :)