Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PropertyInfo] added handling of nullable types in PhpDoc#27618

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.4fromoxan:propertyinfo-fix-nullable-phpdoc
Jul 2, 2018
Merged

[PropertyInfo] added handling of nullable types in PhpDoc#27618

fabpot merged 1 commit intosymfony:3.4fromoxan:propertyinfo-fix-nullable-phpdoc
Jul 2, 2018

Conversation

oxan
Copy link
Contributor

While not specified in PSR-5, PhpDocumentor does support parsing nullable types in the PHP 7.1 syntax (i.e.?string), and returns those in aNullable wrapper type. We currently don't handle this and neither throw an error, which results in all kind of weird breakage when this syntax is used (e.g. "class string|int not found").

Correctly parse this syntax into a nullable type.

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

@oxan
Copy link
ContributorAuthor

Okay, so the tests fail becausephpdocumentor/typeresolver only parses nullable types from v0.3.0 onwards, and we require v0.2.1+. Should I bump the dependency or make the tests conditional?

@nicolas-grekas
Copy link
Member

Given 0.3 supports 5.5, which is the minimum version of Symfony 3.4, I think it's fine bumping.

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneJun 17, 2018
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

bump pending :)

While not specified in PSR-5, PhpDocumentor does support parsingnullable types in the PHP 7.1 syntax (i.e. ?string), and returns thosein a Nullable wrapper. We currently don't handle this and neither throwan error, which results in all kind of weird breakage when this syntaxis used (e.g. "class string|int not found").Correctly parse this syntax into a nullable type.
@oxan
Copy link
ContributorAuthor

oxan commentedJul 1, 2018

@nicolas-grekas I fixed the dependency (& tests are working now) :)

Copy link
Member

@dunglasdunglas left a comment

Choose a reason for hiding this comment

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

Nice one, thanks!

@fabpot
Copy link
Member

Thank you@oxan.

@fabpotfabpot merged commit38b369b intosymfony:3.4Jul 2, 2018
fabpot added a commit that referenced this pull requestJul 2, 2018
…(oxan)This PR was merged into the 3.4 branch.Discussion----------[PropertyInfo] added handling of nullable types in PhpDocWhile not specified in PSR-5, PhpDocumentor does support parsing nullable types in the PHP 7.1 syntax (i.e. `?string`), and returns those in a `Nullable` wrapper type. We currently don't handle this and neither throw an error, which results in all kind of weird breakage when this syntax is used (e.g. "class string|int not found").Correctly parse this syntax into a nullable type.| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aCommits-------38b369b [PropertyInfo] added handling of nullable types in PhpDoc
@oxanoxan deleted the propertyinfo-fix-nullable-phpdoc branchJuly 2, 2018 16:52
This was referencedJul 23, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas requested changes

@fabpotfabpotfabpot approved these changes

@dunglasdunglasdunglas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
3.4
Development

Successfully merging this pull request may close these issues.

5 participants
@oxan@nicolas-grekas@fabpot@dunglas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp