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

Error when event is triggered that does not conform to expected structure #386

Open
MichelJonkman opened this issue Oct 14, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MichelJonkman
Copy link

MichelJonkman commented Oct 14, 2024

Description

Hybridly throws the "hybridly.response" event that has an array as it's first parameter. This causes the following error to occur.

Error: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given

Thrown in : nativephp\laravel\src\Events\EventWatcher.php:22

Expected Fix

Add the below code on nativephp\laravel\src\Events\EventWatcher.php:18

if(!is_object($event)) {
    return;
}

Package Versions

nativephp/electron:0.7.3 nativephp/laravel:0.5.7 nativephp/php-bin:0.5.4

PHP Version

8.2

Laravel Version

11.27.2

Which operating systems have you seen this occur on?

Windows

OS version

10

@MichelJonkman MichelJonkman added the bug Something isn't working label Oct 14, 2024
@simonhamp

This comment was marked as outdated.

@simonhamp
Copy link
Member

@MichelJonkman please could you update your dependencies to the latest versions and try again?

You should be able to do this simply by re-requiring nativephp/electron:

composer require nativephp/electron

Please let me know if the problem persists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants