Skip to content
Snippets Groups Projects
Commit c6a747d6 authored by Fabien Potencier's avatar Fabien Potencier
Browse files

minor #38403 Remove array return type from Request::toArray() (GrahamCampbell)

This PR was merged into the 5.2-dev branch.

Discussion
----------

Remove array return type from Request::toArray()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38400
| License       | MIT
| Doc PR        | -

Laravel already extends Symfony's `Request` class and defines it's own `toArray` method. https://github.com/symfony/symfony/pull/38224 added a new `toArray` method to this class with a different signature to the one that is in Laravel, causing fatal errors (https://github.com/laravel/framework/issues/34660). I think the best course of action here is to remove the return type for now, and only add it in Symfony 6. This will allow Symfony 6.0 and Laravel 11 to synchronize adding the return type.

Older versions of Laravel can't just change their signature to add an array return type to them, because that would be a breaking change for Laravel users extending Laravel's request class. I'm thinking, in particular, API packages and the like, or just straight up application code.

Commits
-------

8b291a49 Remove array return type from Request::toArray()
parents 200392e4 8b291a49
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment