bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!
2.66k stars 446 forks source link

CLI\Agent bug - server events are protected #1215

Open Saacy opened 3 years ago

Saacy commented 3 years ago

Hello. There is a problem with CLI\Agent class - it is trying to get events from CLI\WS object but those are protected.

/lib/cli/ws.php

Lines: 402-403

isset($this->server->events['send']) && is_callable($func=$this->server->events['send']))

Lines: 462-463

if (isset($this->server->events['disconnect']) && is_callable($func=$this->server->events['disconnect']))

Lines: 482-483

if (isset($server->events['connect']) && is_callable($func=$server->events['connect']))

You can fix it with $this->server->events()['send'], $this->server->events()['disconnect'] and $server->events()['connect'].