Remove deprecated Protocol:setClient()

This commit is contained in:
Deon George 2023-12-10 20:44:15 +11:00
parent 0526500ff0
commit ab5476d373
2 changed files with 6 additions and 13 deletions

View File

@ -168,6 +168,10 @@ abstract class Protocol
$this->comms[$key] = $value; $this->comms[$key] = $value;
break; break;
case 'client':
$this->{$key} = $value;
break;
default: default:
throw new \Exception('Unknown key: '.$key); throw new \Exception('Unknown key: '.$key);
} }
@ -359,7 +363,7 @@ abstract class Protocol
// We are an IP node // We are an IP node
$this->optionSet(self::O_TCP); $this->optionSet(self::O_TCP);
$this->setClient($client); $this->client = $client;
switch ($mo->name) { switch ($mo->name) {
case 'EMSI': case 'EMSI':
@ -484,15 +488,4 @@ abstract class Protocol
{ {
$this->session |= $key; $this->session |= $key;
} }
/**
* Set our client that we are communicating with
*
* @param SocketClient $client
* @deprecated use __get()/__set()
*/
protected function setClient(SocketClient $client): void
{
$this->client = $client;
}
} }

View File

@ -71,7 +71,7 @@ final class DNS extends BaseProtocol
if (! parent::onConnect($client)) { if (! parent::onConnect($client)) {
Log::withContext(['pid'=>getmypid()]); Log::withContext(['pid'=>getmypid()]);
$this->setClient($client); $this->client = $client;
$this->protocol_session(); $this->protocol_session();
Log::info(sprintf('%s:= onConnect - Connection closed [%s]',self::LOGKEY,$client->address_remote)); Log::info(sprintf('%s:= onConnect - Connection closed [%s]',self::LOGKEY,$client->address_remote));