PUGX / shortid-php

An implementation of ShortId in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP 8.1 support

acelaya opened this issue · comments

Hey!

I see this project is not being actively built against PHP 8.1

I'm testing the library with PHP 8.1 and it is throwing some deprecation warnings. These two, specifically:

Deprecated: Return type of PUGX\Shortid\Shortid::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/vendor/pugx/shortid-php/src/Shortid.php on line 64

Deprecated: PUGX\Shortid\Shortid implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /app/vendor/pugx/shortid-php/src/Shortid.php on line 5

Would you be open to support PHP 8.1 and add it to the build pipeline? If so, I'm willing to contribute the change.

This should fix the warnings and start running the build on PHP 8.1 #17

Hey, thank you for your interest in this project!
I just approved the running of actions on your PR, could you take a look at the failures?

Thanks!

I can fix this one on this PR:

image

The rest on the other hand, are not introduced by this PR. I'll open a separated PR to be merged before, and then rebase this branch once that one is merged.

The problem is most probably that the last build was run several months ago, and dependencies are not locked, so that has most probably caused a few dependencies to be installed on newer versions which are not 100% compatible.

The problem is most probably that the last build was run several months ago, and dependencies are not locked, so that has most probably caused a few dependencies to be installed on newer versions which are not 100% compatible.

I think the problem is different: the library we use for running phpstan in Github actions get the latest version, and phpstan had changed something between version 0 and version 1. It shouldn't be a problem until the next phpstan major version

PHPStan fixed https://github.com/acelaya-forks/shortid-php/runs/4444749428?check_suite_focus=true

Once I have fixed the tests, I'll create separated PR

The error in the tests seems to be a known issue introduced in one of the latest versions of aktions/codeclimate-test-reporter

See aktions/codeclimate-test-reporter#17

Probably pinning to something more strict than @v1 should fix the issue. I guess this bug is in the latest v1.x version, but was not there in the v1.x that was installed last time the build was run. I'll try to figure out which one was it.

I have created #16

Can you approve the build? I couldn't verify the tests on my side, as I'm missing the CC_TEST_REPORTER_ID secret.

I have rebased the branch with the fixes from master, and added the missing types for PHPStan.

For some reason the original PR got closed, maybe because I did a git push -f, so I had to create a new PR #19