From ab5476d373b51c1e51fee1e9a6f5d695d3ee95d7 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 10 Dec 2023 20:44:15 +1100 Subject: [PATCH] Remove deprecated Protocol:setClient() --- app/Classes/Protocol.php | 17 +++++------------ app/Classes/Protocol/DNS.php | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/app/Classes/Protocol.php b/app/Classes/Protocol.php index f683fc5..1574497 100644 --- a/app/Classes/Protocol.php +++ b/app/Classes/Protocol.php @@ -168,6 +168,10 @@ abstract class Protocol $this->comms[$key] = $value; break; + case 'client': + $this->{$key} = $value; + break; + default: throw new \Exception('Unknown key: '.$key); } @@ -359,7 +363,7 @@ abstract class Protocol // We are an IP node $this->optionSet(self::O_TCP); - $this->setClient($client); + $this->client = $client; switch ($mo->name) { case 'EMSI': @@ -484,15 +488,4 @@ abstract class Protocol { $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; - } } \ No newline at end of file diff --git a/app/Classes/Protocol/DNS.php b/app/Classes/Protocol/DNS.php index 6acb9f1..cd18ea9 100644 --- a/app/Classes/Protocol/DNS.php +++ b/app/Classes/Protocol/DNS.php @@ -71,7 +71,7 @@ final class DNS extends BaseProtocol if (! parent::onConnect($client)) { Log::withContext(['pid'=>getmypid()]); - $this->setClient($client); + $this->client = $client; $this->protocol_session(); Log::info(sprintf('%s:= onConnect - Connection closed [%s]',self::LOGKEY,$client->address_remote));