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 mixed return type for filter callbacks #131

Conversation

Hug0-Drelon
Copy link
Contributor

Issue:

I get the following error for a filter callback with a mixed return type:

Filter callback return statement is missing.

This occurs with a callback like this:

/**
 * Does things.
 *
 * @param mixed  $param  Some value.
 * @return mixed
 */
function do_things( $param ) {
    // Do things
    return $param
}

IMHO this is due to this line where we get MixedType which seems to be a super type of VoidType (maybe because it include NullType.

Proposal:

  • Add a special case for MixedType.
  • Add a test for a callback with mixed return type.

@szepeviktor
Copy link
Owner

@herndlm @johnbillion Please help @Hug0-Drelon with his issue.

@szepeviktor
Copy link
Owner

szepeviktor commented Nov 11, 2022

I think "we" are working on this in #130

@Hug0-Drelon
Copy link
Contributor Author

Oops, I should have look into previous PRs... Sorry.
Also, I have a hard time to run PHPUnit, for unknown reason it doesn't work locally...

@szepeviktor
Copy link
Owner

szepeviktor commented Nov 11, 2022

I have a hard time to run PHPUnit

Set memory_limit in your php.ini: #129

@Hug0-Drelon
Copy link
Contributor Author

Useless since #130 is merged and fixed the issue.

@Hug0-Drelon Hug0-Drelon deleted the fix-mixed-return-type-for-callbacks branch November 14, 2022 09:03
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.

None yet

2 participants