Skip to content

[PropertyInfo] Use iterators for PropertyInfoExtractor #21654

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
Feb 18, 2017

Conversation

GuilhemN
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Most of the time, when using the cache, the property info extractors are not used: the new iterator feature looks perfect to prevent their instantiation.

* @param array $extractors
* @param string $method
* @param array $arguments
* @param array|\Traversable $extractors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iterable would describe it 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use it in php docs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and we already did :)

Copy link
Contributor Author

@GuilhemN GuilhemN Feb 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great! updated

@stof
Copy link
Member

stof commented Feb 17, 2017

👍
Status: reviewed

@stof
Copy link
Member

stof commented Feb 17, 2017

Actually, you need to add a conflict rule in FrameworkBundle, to forbid it to use an older property-info component (which would have an array typehint), if we don't have the conflict already

@GuilhemN
Copy link
Contributor Author

Indeed, thanks!

@dunglas
Copy link
Member

dunglas commented Feb 17, 2017

👍

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Feb 18, 2017
@nicolas-grekas
Copy link
Member

Thank you @GuilhemN.

@nicolas-grekas nicolas-grekas merged commit 38523a9 into symfony:master Feb 18, 2017
nicolas-grekas added a commit that referenced this pull request Feb 18, 2017
… (GuilhemN)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[PropertyInfo] Use iterators for PropertyInfoExtractor

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Most of the time, when using the cache, the property info extractors are not used: the new iterator feature looks perfect to prevent their instantiation.

Commits
-------

38523a9 [PropertyInfo] Use iterators for PropertyInfoExtractor
@GuilhemN GuilhemN deleted the PROPERTYINFO branch February 18, 2017 08:15
* @param PropertyTypeExtractorInterface[] $typeExtractors
* @param PropertyDescriptionExtractorInterface[] $descriptionExtractors
* @param PropertyAccessExtractorInterface[] $accessExtractors
* @param iterable|PropertyListExtractorInterface[] $listExtractors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iterable is not a valid keyword, even according to the (still) draft PSR-5. See phpDocumentor/fig-standards#141

But anyway I think it's redundant to write it like this, it should be simply iterable<PropertyListExtractorInterface>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nor is @final, its support will come when it will be adopted so imo it's not a problem.

About the redundancy I agree but we would lose all completion until editors add generics support, I don't think it's acceptable.

Copy link
Member

@dunglas dunglas Feb 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, the RFC for introducing an iterable keyword has been accepted and PHP 7.1 supports this type: https://wiki.php.net/rfc/iterable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dunglas That's for PHP, not PHPDoc 😄

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.

7 participants