Skip to content

Commit c207793

Browse files
committed
Fixed error 'method_exists(): Argument NativePHP#1 ($object_or_class) must be of type object|string, array given' when using Darryldecode\Cart\Cart.
1 parent a8b0a72 commit c207793

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Events/EventWatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function __construct(protected Client $client) {}
1212
public function register(): void
1313
{
1414
Event::listen('*', function (string $eventName, array $data) {
15-
$event = $data[0] ?? (object) null;
15+
$event = (object)($data[0] ?? null);
1616

1717
if (! method_exists($event, 'broadcastOn')) {
1818
return;

0 commit comments

Comments
 (0)