Skip to content
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

Suppress deprecation notices in PHP 8.0+ #43

Closed

Conversation

derekmd
Copy link

@derekmd derekmd commented Jul 24, 2022

Alternate to #42

Suppress deprecation notices in PHP 8.0 and 8.1 from internal languages methods missing return typehints.

PHP Deprecated: Return type of Jenssengers\Model\Model::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 vendor/jenssegers/model/src/Model.php on line 866

Instead of adding those explicit return types (and breaking support with older PHP versions), add attribute #[\ReturnTypeWillChange] to the same Illuminate\Database\Eloquent\Model methods as "laravel/framework" 8.x (https://github.com/laravel/framework/blob/888947cedacbefac4019a163ccf941e592edad82/src/Illuminate/Database/Eloquent/Model.php):

  • offsetExists
  • offsetGet
  • offsetSet
  • offsetUnset
  • jsonSerialize

@derekmd derekmd changed the title Suppress depreciation notices in PHP 8.0+ Suppress deprecated notices in PHP 8.0+ Jul 24, 2022
@derekmd derekmd changed the title Suppress deprecated notices in PHP 8.0+ Suppress deprecation notices in PHP 8.0+ Jul 24, 2022
@derekmd derekmd force-pushed the remove-php-8-deprecation-notices branch from 0c8550e to 22fc190 Compare July 24, 2022 21:19
@dreammonkey
Copy link

Hi, I would like to check the status on this because I might want to use this package in a project I'm working on.
It looks like a code styling issue is blocking this merge request ? Is that correct?

Please let me know if there is anything I can do to contribute !

@JoshMountain
Copy link

Would love to get this merged and get rid of these warnings.

Suppress PHP 8.0+ deprecation notices from internal methods missing
explicit return types. This copies "laravel/framework" 8.x file
Illuminate\Database\Eloquent\Model.
@derekmd derekmd force-pushed the remove-php-8-deprecation-notices branch from 22fc190 to 2ba10df Compare March 28, 2023 00:42
@jarikoff
Copy link

jarikoff commented May 3, 2023

Hi everyone !
Any updates on this ?

@sasha-b-a sasha-b-a mentioned this pull request May 3, 2023
@jenssegers jenssegers closed this Jul 25, 2024
@derekmd derekmd deleted the remove-php-8-deprecation-notices branch July 25, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants