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 error_handler type hints #59

Merged
merged 1 commit into from
Jul 2, 2019
Merged

Conversation

ScullWM
Copy link
Contributor

@ScullWM ScullWM commented Jun 26, 2019

Hi,

I've updated the error_handler typehinting, mostly the return type declarations.
From php.net documentation, the error_handler should return a bool and not a void (https://www.php.net/manual/en/function.set-error-handler.php).

Thanks to psalm 👍

ERROR: InvalidArgument - src/Doctrine/Instantiator/Instantiator.php:135:27 - Argument 1 of set_error_handler expects null|callable(int, string, string=, int=, array<array-key, mixed>=):bool, Closure(int, string, string, int):void provided
        set_error_handler(static function (int $code, string $message, string $file, int $line) use ($reflectionClass, & $error) : void {
            $error = UnexpectedValueException::fromUncleanUnSerialization(
                $reflectionClass,
                $message,
                $code,
                $file,
                $line
            );
        });

@lcobucci lcobucci added this to the 2.0 milestone Jul 2, 2019
@lcobucci lcobucci self-assigned this Jul 2, 2019
Copy link
Member

@lcobucci lcobucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ScullWM awesome, thanks!

@lcobucci lcobucci merged commit 7c71fc2 into doctrine:master Jul 2, 2019
@Ocramius Ocramius modified the milestones: 2.0, 1.3.0 Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants