11<?php
22
3- /*
4- * This file is part of net-mqtt.
5- *
6- * Copyright (c) 2015 Sebastian Mößler [email protected] 7- *
8- * This source file is subject to the MIT license.
9- */
3+ declare (strict_types=1 );
104
115namespace Fbns \Client \Lite ;
126
@@ -66,22 +60,16 @@ public function write(PacketStream $stream): void
6660
6761 /**
6862 * Returns the protocol level.
69- *
70- * @return int
7163 */
72- public function getProtocolLevel ()
64+ public function getProtocolLevel (): int
7365 {
7466 return $ this ->protocolLevel ;
7567 }
7668
7769 /**
7870 * Sets the protocol level.
79- *
80- * @param int $value
81- *
82- * @throws \InvalidArgumentException
8371 */
84- public function setProtocolLevel ($ value )
72+ public function setProtocolLevel (int $ value ): void
8573 {
8674 if ($ value != 3 ) {
8775 throw new \InvalidArgumentException (sprintf ('Unknown protocol level %d. ' , $ value ));
@@ -92,42 +80,32 @@ public function setProtocolLevel($value)
9280
9381 /**
9482 * Returns the payload.
95- *
96- * @return string
9783 */
98- public function getPayload ()
84+ public function getPayload (): string
9985 {
10086 return $ this ->payload ;
10187 }
10288
10389 /**
10490 * Sets the payload.
105- *
106- * @param string $value
10791 */
108- public function setPayload ($ value )
92+ public function setPayload (string $ value )
10993 {
11094 $ this ->payload = $ value ;
11195 }
11296
11397 /**
11498 * Returns the flags.
115- *
116- * @return int
11799 */
118- public function getFlags ()
100+ public function getFlags (): int
119101 {
120102 return $ this ->flags ;
121103 }
122104
123105 /**
124106 * Sets the flags.
125- *
126- * @param int $value
127- *
128- * @throws \InvalidArgumentException
129107 */
130- public function setFlags ($ value )
108+ public function setFlags (int $ value )
131109 {
132110 if ($ value > 255 ) {
133111 throw new \InvalidArgumentException (sprintf ('Expected a flags lower than 255 but got %d. ' , $ value ));
@@ -138,22 +116,16 @@ public function setFlags($value)
138116
139117 /**
140118 * Returns the keep alive time in seconds.
141- *
142- * @return int
143119 */
144- public function getKeepAlive ()
120+ public function getKeepAlive (): int
145121 {
146122 return $ this ->keepAlive ;
147123 }
148124
149125 /**
150126 * Sets the keep alive time in seconds.
151- *
152- * @param int $value
153- *
154- * @throws \InvalidArgumentException
155127 */
156- public function setKeepAlive ($ value )
128+ public function setKeepAlive (int $ value ): void
157129 {
158130 if ($ value > 65535 ) {
159131 throw new \InvalidArgumentException (sprintf ('Expected a keep alive time lower than 65535 but got %d. ' , $ value ));
@@ -164,22 +136,16 @@ public function setKeepAlive($value)
164136
165137 /**
166138 * Returns the protocol name.
167- *
168- * @return string
169139 */
170- public function getProtocolName ()
140+ public function getProtocolName (): string
171141 {
172142 return $ this ->protocolName ;
173143 }
174144
175145 /**
176146 * Sets the protocol name.
177- *
178- * @param string $value
179- *
180- * @throws \InvalidArgumentException
181147 */
182- public function setProtocolName ($ value )
148+ public function setProtocolName (string $ value ): void
183149 {
184150 $ this ->assertValidStringLength ($ value , false );
185151
0 commit comments