Skip to content

[TypeDeclarationDocblocks] Only touch private methods in AddParamArrayDocblockFromAssignsParamToParamReferenceRector - #8436

Open
TomasVotruba wants to merge 1 commit into
mainfrom
tv/param-byref-skip-non-private
Open

[TypeDeclarationDocblocks] Only touch private methods in AddParamArrayDocblockFromAssignsParamToParamReferenceRector#8436
TomasVotruba wants to merge 1 commit into
mainfrom
tv/param-byref-skip-non-private

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

A by-ref array param type is invariant in PHPStan. Narrowing it below array makes every caller passing a plain array fail:

Parameter &$data by-ref type of method OneSignalApi::addMobileData()
expects array<array<mixed>|string|null>, array given.

For a protected or public method those callers live outside the class and are invisible here, so restrict the rule to private methods. The public run() fixtures are converted to private.

…yDocblockFromAssignsParamToParamReferenceRector

A by-ref array param type is invariant in PHPStan: narrowing it below array
makes every caller passing a plain array fail. For a protected or public
method those callers live outside the class and are invisible here, so
restrict the rule to private methods.
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.

1 participant