Skip to content

Conversation

hemberger
Copy link

@hemberger hemberger commented Mar 3, 2023

The nullable field returned from SignatureTrait::getMethodSignature is used by DocBlockParamAllowDefaultValueSniff assuming that it means whether or not the parameter accepts null, so we need to also check if an explicit null is part of the typehint. This is because in the arrays returned by File::getMethodParameters, the nullable_type field only indicates if the typehint is prefixed with "?".

Fixes #368.

Checklist

  • I agree with the Code Contribution License Agreement in CONTRIBUTING.md

The `nullable` field returned from SignatureTrait::getMethodSignature
is used by DocBlockParamAllowDefaultValueSniff assuming that it means
whether or not the parameter accepts null, so we need to also check if
an explicit null is part of the typehint. This is because in the arrays
returned by File::getMethodParameters, the `nullable_type` field only
indicates if the typehint is prefixed with "?".

Fixes spryker#368.
@dereuromark
Copy link
Contributor

Looks good to me!
Cc @gechetspr

@dereuromark
Copy link
Contributor

ping @gechetspr

@skrollme
Copy link

Is it planned to merge this PR in the near future? We run into sniffer-problems which would be solved by this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

WrongNullable false positive
4 participants