使用ClientInterface优化

This commit is contained in:
Rhilip
2020-01-17 11:20:27 +08:00
parent 32e14f9471
commit 255c7c4a2f
5 changed files with 69 additions and 31 deletions

View File

@ -11,4 +11,11 @@ namespace IYUU\Client;
interface AbstractClientInterface
{
/**
* 查询Bittorrent客户端状态
*
* @return string
*/
public function status();
}

View File

@ -758,4 +758,12 @@ class TransmissionRPC implements AbstractClientInterface
}
return $this->session_id;
}
/**
* @inheritDoc
*/
public function status()
{
return $this->sstats();
}
}

View File

@ -295,4 +295,12 @@ class qBittorrent implements AbstractClientInterface
$data .= "--" . $this->delimiter . "--" . $eol;
return $data;
}
/**
* @inheritDoc
*/
public function status()
{
return $this->appVersion();
}
}