8000 [PropertyInfo] Support for the mixed type by derrabus · Pull Request #38510 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PropertyInfo] Support for the mixed type #38510

New issu 8000 e

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

Merged
merged 1 commit into from
Oct 11, 2020

Conversation

derrabus
Copy link
Member
Q A
Branch? 3.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

In php 8, mixed is a valid type declaration.

Running the following script on php 8…

use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;

class MyClass
{
    public function getA(): mixed {}
}

$reflection = new ReflectionExtractor();
$reflection->getTypes(MyClass::class, 'a');

… causes a fatal error:

PHP Fatal error:  Uncaught InvalidArgumentException: "mixed" is not a valid PHP type. in /path/to/symfony/src/Symfony/Component/PropertyInfo/Type.php:70

This PR should fix the issue.

@fabpot
Copy link
Member
fabpot commented Oct 11, 2020

Thank you @derrabus.

@fabpot fabpot merged commit 7173d6c into symfony:3.4 Oct 11, 2020
@derrabus derrabus deleted the bugfix/property-info-mixed branch October 11, 2020 10:25
@fabpot fabpot mentioned this pull request Oct 14, 2020
This was referenced Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to com 6797 ment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0