Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Support PHP8#84

Open
dpi wants to merge 3 commits intojwage:masterfrom
dpi:php8
Open

Support PHP8#84
dpi wants to merge 3 commits intojwage:masterfrom
dpi:php8

Conversation

@dpi
Copy link

@dpi dpi commented Mar 8, 2021

Fixes #83

doctrine/coding-standard ^6 and ^7 only supports PHP ^7.1, so updated to branch 8. (9 is also available.)

Updated phpstan/phpstan + phpstan/phpstan-strict-rules from ^0.11 to ^0.12 to support PHP 8.

Removed PHP 5 reference from composer.json

Ran phpcbf, which fixed all CS fails as a result of updating.

The two removed sniffs no longer exist (didnt look for the replacements, if any)

__set magic method is only allowed to return void in PHP8: https://3v4l.org/uiGk3

@dpi dpi force-pushed the php8 branch 2 times, most recently from 830cfd2 to 4065ae6 Compare March 8, 2021 07:32
@holtkamp
Copy link

@jwage did you notice this Pull Request?

@holtkamp
Copy link

holtkamp commented Sep 16, 2022

@dpi on PHP 8.1 this kind of deprecation messages is generated:

PHP Deprecated: Return type of Purl\AbstractPart::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../vendor/jwage/purl/src/Purl/AbstractPart.php:139

PHP Deprecated: Return type of Purl\AbstractPart::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Might be useful to also resolve this in your patch?

https://github.com/dpi/purl/blob/php8/src/Purl/AbstractPart.php#L139

@dpi
Copy link
Author

dpi commented Sep 16, 2022

Id like to get a preference from the maintainer. Whether he prefers to litter the current branch with attributes or fix the issue with a new major/minor. Or both.

@holtkamp
Copy link

holtkamp commented Sep 16, 2022

@dpi yeah I agree

@jwage any thoughts on this?

I gave it a shot myself at https://github.com/holtkamp/purl/tree/patch-php-8.1 for PHP 8.1 to reduce the amount of errors reported by monitoring tools like New Relic

@barchard
Copy link

This a great util library, but it seems like it may be abandoned? Anyone have suggestions for an alternate library?

@jwage
Copy link
Owner

jwage commented Feb 20, 2023

I am no longer personally using this library and don't have the time to maintain it. Happy to hand over the maintenance to someone else. Here is an alternative maintained library https://uri.thephpleague.com/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support PHP8

5 participants