php-sru-client icon indicating copy to clipboard operation
php-sru-client copied to clipboard

v0.7.2: PHP 8 = requirement(?)

Open sommer-gei opened this issue 2 years ago • 2 comments

Hey @danmichaelo + @S1SYPHOS !

Today I made a little update to one of my projects, where I'm glad to use php-sru-client, and mentioned composer updated this package from version 0.7.1 to 0.7.2. After that my script ended with the following error, while doing a SRU request:

"PHP message: PHP Parse error:  syntax error, unexpected '|', expecting variable (T_VARIABLE) in /server/path/vendor/scriptotek/sru-client/src/Record.php on line 52"

After some investigation and code research I came up with the following 3 things:

  1. I don't know why composer only today updated to 0.7.2; I initiated the project only some weeks ago = when 0.7.2 was still out.
  2. I think the changes from 0.7.1 to 0.7.2 introduced PHP 8.0 as minimum PHP version.
    • This change is the cause of my/the error message with PHP 7.4
  3. The CHANGELOG.md misses the IMHO important change for 0.7.2 (see 2.).

My current fix is to pin this package (by composer) to 0.7.1, to use it with PHP 7.4.

I also will add some notes to CHANGELOG.md and make a PR.

Thanks for fixing in advance and KR!

sommer-gei avatar Jul 18 '23 11:07 sommer-gei

Thanks for letting us know! I can't guarantee anything as I'm totally busy right now, but maybe I can take a look over the weekend 😉

S1SYPHOS avatar Jul 19 '23 08:07 S1SYPHOS

Sorry about that, @sommer-gei, I should have created a major release for this change! Pinning to 0.7.1 is the solution for PHP < 8 . I'll keep the issue open so it's easy for others to find

danmichaelo avatar Mar 11 '24 21:03 danmichaelo