Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[PropertyInfo] Add support for typed properties (PHP 7.4) #34557

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

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Nov 23, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets n/a
License MIT
Doc PR n/a

Add support for typed properties, a new feature introduced in PHP 7.4:

class Foo
{
    public Bar $bar;
    private ?bool $nullableBoolProp;
}

$this->extractor->getTypes(Foo::class, 'bar'); // Type[]
$this->extractor->getTypes(Foo::class, 'nullableBoolProp'); // Type[]

#SymfonyHackday

@nicolas-grekas nicolas-grekas added this to the next milestone Nov 24, 2019
@fabpot
Copy link
Member

fabpot commented Nov 25, 2019

Thank you @dunglas.

@ro0NL
Copy link
Contributor

ro0NL commented Mar 4, 2020

@fabpot @dunglas please consider for 4.4/5.0 :} while technically a new feature.. it's common to remove @var annotations when moving to php74 typed properties, if not the obvious thing to do.

However, doing so requires this PR for compatibility.. hence it's a bugfix IMHO.

@dunglas
Copy link
Member Author

dunglas commented Apr 13, 2020

I'm not against backporting this to 4.4. I can take car of this. What do you think @fabpot @nicolas-grekas?

@chalasr
Copy link
Member

chalasr commented Apr 13, 2020

👍 for backporting.

@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
@fabpot fabpot mentioned this pull request May 5, 2020
fabpot added a commit that referenced this pull request Aug 28, 2020
…7.4) (dunglas)

This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] Backport support for typed properties (PHP 7.4)

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | N/A. <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#13719 to be fixed

Backports #34557 as suggested.

One of my workmate hit this issue with the Serializer component and it was not obvious for him why it was not working, without hint.

Commits
-------

1b19f25 [PropertyInfo] Backport support for typed properties (PHP 7.4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants