public function __construct(TRpcServer $rpcServer) { $this->rpcServer = $rpcServer; foreach ($this->registerMethods() as $_methodName => $_methodDetails) { $this->rpcServer->addRpcMethod($_methodName, $_methodDetails); } }