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

Implement PHP 8.1's ArrayAccess interface #3454

Merged
merged 3 commits into from
Dec 2, 2021

Conversation

grantholle
Copy link
Contributor

@grantholle grantholle commented Dec 2, 2021

PHP 8.1 enforces return types for ArrayAccess implementations.

Please take note of our contributing guidelines: https://docs.laravel-excel.com/3.1/getting-started/contributing.html
Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.

1️⃣ Why should it be added? What are the benefits of this change?

PHP 8.1 Support

2️⃣ Does it contain multiple, unrelated changes? Please separate the PRs out.

No

3️⃣ Does it include tests, if possible?

No

4️⃣ Any drawbacks? Possible breaking changes?

I believe that the minimum version PHP 7.2 should be ok, but can't say for certain.

5️⃣ Mark the following tasks as done:

  • Checked the codebase to ensure that your feature doesn't already exist.
  • Take note of the contributing guidelines.
  • Checked the pull requests to ensure that another person hasn't already submitted a fix.
  • Added tests to ensure against regression.
  • Updated the changelog

6️⃣ Thanks for contributing! 🙌

PHP 8.1 enforces return types for `ArrayAccess` implementations.
@patrickbrouwers
Copy link
Member

Thanks 👍

Running the change against all PHP versions now

@grantholle
Copy link
Contributor Author

grantholle commented Dec 2, 2021

It looks like mixed is getting scoped weird. I think I need to change it to \mixed?

@patrickbrouwers
Copy link
Member

Hm that's annoying, I'm afraid that is a breaking change that will have to result into dropping support for PHP7.x Let me think about this first.

@patrickbrouwers
Copy link
Member

Think I found a way by using #[\ReturnTypeWillChange]

@patrickbrouwers patrickbrouwers merged commit 369537c into SpartnerNL:3.1 Dec 2, 2021
@grantholle
Copy link
Contributor Author

Great!

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.

None yet

2 participants