Skip to content
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

fix: illegal offset type on file-wide return in ReturnToYieldFromFixer #7318

Merged

Conversation

juliangut
Copy link
Contributor

@juliangut juliangut commented Sep 23, 2023

Hopefully fixes #7317

@Wirone Wirone changed the title fix illegal offset type on file-wide return fix: illegal offset type on file-wide return Sep 23, 2023
@Wirone
Copy link
Member

Wirone commented Sep 23, 2023

Thanks @juliangut for the contribution, but according to the contributing guide you should provide first commit with test case that reproduces the issue, and after CI failure provide the fix 🙂. Minimal requirement is a test case along with a fix, without test case we can't merge it.

@coveralls
Copy link

coveralls commented Sep 23, 2023

Coverage Status

coverage: 94.652% (+0.004%) from 94.648% when pulling 64ada60 on juliangut:fix/returntoyieldfrom-offset-type into aafd2d6 on PHP-CS-Fixer:master.

@juliangut
Copy link
Contributor Author

@Wirone hope the PR now follows contribution guidelines

@SpacePossum
Copy link
Contributor

could you add this test?: (it will pass btw)

        yield [
            '<?php
function foo(): iterable { return $z; }

return [1,2] ?>  X  <?php { echo 2; }'
        ];

I think your PR/fix is solid 👍

@Wirone
Copy link
Member

Wirone commented Sep 26, 2023

use yoda style you must

❤️😆

Looks good, please add @SpacePossum's test case, rebase the branch and it'll be ready for merge 👍.

@juliangut
Copy link
Contributor Author

New test added. I've merged instead of rebased, hope it's not a problem, I assume PR will be squashed into a single commit anyway

@Wirone Wirone changed the title fix: illegal offset type on file-wide return fix: illegal offset type on file-wide return in ReturnToYieldFromFixer Sep 26, 2023
@Wirone Wirone enabled auto-merge (squash) September 26, 2023 16:22
@Wirone Wirone merged commit de07904 into PHP-CS-Fixer:master Sep 26, 2023
15 checks passed
@Wirone
Copy link
Member

Wirone commented Sep 26, 2023

Thanks @juliangut and welcome to Fixer's contributors group 🍻!

@SpacePossum
Copy link
Contributor

thanks @juliangut , nice fix :)

@juliangut juliangut deleted the fix/returntoyieldfrom-offset-type branch September 27, 2023 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReturnToYieldFromFixer error on file-wide return
4 participants