Detect nullable types in phpdoc by BladeMF · Pull Request #445 · atom/language-php · GitHub
Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Detect nullable types in phpdoc - #445

Merged
darangi merged 2 commits into
atom:masterfrom
BladeMF:phpdoc-nullable-types
Jan 13, 2022
Merged

darangi merged 2 commits into
atom:masterfrom
BladeMF:phpdoc-nullable-types

Conversation

@BladeMF

@BladeMF BladeMF commented Oct 31, 2021

Copy link
Copy Markdown
Contributor

Description of the Change

Allow the following syntaxes in phpdoc:

/**
 * @param ?int description
 */
/**
 * @param ?int|?Class description
 */
/**
 * @param ?int[] description
 */

Alternate Designs

I am not aware of any other alternatives.

Benefits

Allow the new nullable type syntax.

Possible Drawbacks

Not aware of any drawbacks. The change is minor.

Applicable Issues

That is a step towards solving the need in this issue.

Note

That is my first pull request to this repo. It's purpose is to be something small that will allow me to learn how to do effective PRs here - learn the rules and pracices, set up the tooling.

My main goal is to ultimately add detection for:

  • Psalm complex array types
  • PHPStan comments (@phpstan-ignore-line)
  • PHPUnit attributes (@test, @dataProvider, etc.)

Comment thread grammars/php.cson
@KapitanOczywisty

Copy link
Copy Markdown
Contributor

@darangi

darangi commented Jan 13, 2022

Copy link
Copy Markdown
Contributor

Thanks for the contribution 🙇🏾 @BladeMF

@darangi
darangi merged commit 1aa8ddc into atom:master Jan 13, 2022
@BladeMF

BladeMF commented Jan 13, 2022

Copy link
Copy Markdown
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants