I have the error as said in title in the following code (guzzle http lib) please tell me how to fix it manually. I have no idea about function() use () construct to be honest so dont know how to fix it.
public function once($eventName, callable $listener, $priority = 0) {
$onceListener = function (
EventInterface $event,
$eventName
) use (&$onceListener, $eventName, $listener, $priority) {
$this->removeListener($eventName, $onceListener);
$listener($event, $eventName, $this);
};
$this->on($eventName, $onceListener, $priority);
}
Problem is with $eventName after use( construct.