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

Ensure that the return keyword is not used when method returns void type #5878



Copy link

@Jamesking56 Jamesking56 commented Mar 16, 2020

Fixes #5877

When Codeception generates a method action for a method which returns a void type, the method still uses the return keyword causing a PHP error:

Fatal error:  A void function must not return a value

This PR makes the return keyword variable, so that when we're dealing with a method which has a return type of void, we don't use the return keyword at all.

src/Codeception/Lib/Generator/Actions.php Outdated Show resolved Hide resolved
@Naktibalda Naktibalda merged commit 65f0131 into Codeception:4.0 Mar 16, 2020
2 checks passed
Copy link

@Naktibalda Naktibalda commented Mar 16, 2020

This PR received a lot of attention.

Please review my PR too: #5876

Copy link

@Naktibalda Naktibalda commented Mar 17, 2020

Released as 4.1.3, new phar file will be published soon.

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

Successfully merging this pull request may close these issues.

2 participants