@@ -13,16 +13,16 @@ class Client
1313 const RESPONSE_SHORT = 1 ;
1414 const RESPONSE_FULL = 2 ;
1515
16- protected $ _host ;
17- protected $ _port ;
18- protected $ _protocol ;
19- protected $ _login ;
20- protected $ _password ;
21- protected $ _proxy = '' ;
22- protected $ _secretKey ;
23- protected $ _version = '' ;
16+ protected string $ _host ;
17+ protected int $ _port ;
18+ protected string $ _protocol ;
19+ protected string $ _login = '' ;
20+ protected string $ _password = '' ;
21+ protected string $ _proxy = '' ;
22+ protected string $ _secretKey = '' ;
23+ protected string $ _version = '' ;
2424
25- protected $ _operatorsCache = [];
25+ protected array $ _operatorsCache = [];
2626
2727 /**
2828 * @var callable
@@ -36,7 +36,7 @@ class Client
3636 * @param int $port
3737 * @param string $protocol
3838 */
39- public function __construct ($ host , $ port = 8443 , $ protocol = 'https ' )
39+ public function __construct (string $ host , int $ port = 8443 , string $ protocol = 'https ' )
4040 {
4141 $ this ->_host = $ host ;
4242 $ this ->_port = $ port ;
@@ -49,7 +49,7 @@ public function __construct($host, $port = 8443, $protocol = 'https')
4949 * @param string $login
5050 * @param string $password
5151 */
52- public function setCredentials ($ login , $ password )
52+ public function setCredentials (string $ login , string $ password ): void
5353 {
5454 $ this ->_login = $ login ;
5555 $ this ->_password = $ password ;
@@ -60,7 +60,7 @@ public function setCredentials($login, $password)
6060 *
6161 * @param string $secretKey
6262 */
63- public function setSecretKey ($ secretKey )
63+ public function setSecretKey (string $ secretKey ): void
6464 {
6565 $ this ->_secretKey = $ secretKey ;
6666 }
@@ -70,7 +70,7 @@ public function setSecretKey($secretKey)
7070 *
7171 * @param string $proxy
7272 */
73- public function setProxy ($ proxy )
73+ public function setProxy (string $ proxy ): void
7474 {
7575 $ this ->_proxy = $ proxy ;
7676 }
@@ -80,7 +80,7 @@ public function setProxy($proxy)
8080 *
8181 * @param string $version
8282 */
83- public function setVersion ($ version )
83+ public function setVersion (string $ version ): void
8484 {
8585 $ this ->_version = $ version ;
8686 }
@@ -90,7 +90,7 @@ public function setVersion($version)
9090 *
9191 * @param callable|null $function
9292 */
93- public function setVerifyResponse (callable $ function = null )
93+ public function setVerifyResponse (callable $ function = null ): void
9494 {
9595 $ this ->_verifyResponseCallback = $ function ;
9696 }
@@ -100,7 +100,7 @@ public function setVerifyResponse(callable $function = null)
100100 *
101101 * @return string
102102 */
103- public function getHost ()
103+ public function getHost (): string
104104 {
105105 return $ this ->_host ;
106106 }
@@ -110,7 +110,7 @@ public function getHost()
110110 *
111111 * @return int
112112 */
113- public function getPort ()
113+ public function getPort (): int
114114 {
115115 return $ this ->_port ;
116116 }
@@ -120,7 +120,7 @@ public function getPort()
120120 *
121121 * @return string
122122 */
123- public function getProtocol ()
123+ public function getProtocol (): string
124124 {
125125 return $ this ->_protocol ;
126126 }
@@ -132,7 +132,7 @@ public function getProtocol()
132132 *
133133 * @return SimpleXMLElement
134134 */
135- public function getPacket ($ version = null )
135+ public function getPacket ($ version = null ): SimpleXMLElement
136136 {
137137 $ protocolVersion = !is_null ($ version ) ? $ version : $ this ->_version ;
138138 $ content = "<?xml version='1.0' encoding='UTF-8' ?> " ;
@@ -295,7 +295,7 @@ protected function _getHeaders()
295295 *
296296 * @throws Exception
297297 */
298- protected function _verifyResponse ($ xml )
298+ protected function _verifyResponse ($ xml ): void
299299 {
300300 if ($ xml ->system && $ xml ->system ->status && 'error ' == (string ) $ xml ->system ->status ) {
301301 throw new Exception ((string ) $ xml ->system ->errtext , (int ) $ xml ->system ->errcode );
@@ -315,7 +315,7 @@ protected function _verifyResponse($xml)
315315 * @param string $request
316316 * @param SimpleXMLElement $xml
317317 *
318- * @return string
318+ * @return false| string
319319 */
320320 protected function _expandRequestShortSyntax ($ request , SimpleXMLElement $ xml )
321321 {
0 commit comments