Skip to content

PhpdocToParamTypeFixer - fix for void as param #5014

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
Jun 27, 2020
Merged

PhpdocToParamTypeFixer - fix for void as param #5014

merged 1 commit into from
Jun 27, 2020

Conversation

kubawerlos
Copy link
Contributor

Is the test correct?

@kubawerlos kubawerlos added status/help wanted Author requests help kind/bug labels Jun 19, 2020
@kubawerlos kubawerlos changed the title Add test PhpdocToParamTypeFixer - fix for void as param Jun 20, 2020
@SpacePossum
Copy link
Contributor

Fatal error: void cannot be used as a parameter type in

maybe this fixer needs the syntax-checker you wrote as well?

@kubawerlos
Copy link
Contributor Author

For that it will help, but not for the error you can see in Travis:

1) PhpCsFixer\Tests\Fixer\FunctionNotation\PhpdocToParamTypeFixerTest::testFix with data set "void as type" ('<?php /** @param void $bar */...ar) {}', '<?php /** @param void $bar */...ar) {}')
The token at index 7 must be:
{
    "id": 319,
    "name": "T_STRING",
    "content": "void",
    "isArray": true,
    "changed": false
},
got:
{
    "id": null,
    "name": null,
    "content": "void",
    "isArray": false,
    "changed": false
}.
Failed asserting that false is true.

@SpacePossum
Copy link
Contributor

but the fixer should not never try to put void as type right?

@kubawerlos kubawerlos removed the status/help wanted Author requests help label Jun 25, 2020
@SpacePossum SpacePossum added the RTM Ready To Merge label Jun 26, 2020
@keradus keradus added this to the 2.16.4 milestone Jun 27, 2020
@keradus keradus removed the RTM Ready To Merge label Jun 27, 2020
@keradus
Copy link
Member

keradus commented Jun 27, 2020

Thank you @kubawerlos.

@keradus keradus merged commit e1d06c5 into PHP-CS-Fixer:2.16 Jun 27, 2020
@kubawerlos kubawerlos deleted the fix_PhpdocToParamTypeFixer_void branch June 28, 2020 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants