pssht  latest
SSH server library written in PHP
IGNORE.php
1 <?php
2 
3 /*
4 * This file is part of pssht.
5 *
6 * (c) François Poirotte <clicky@erebot.net>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 
12 namespace fpoirotte\Pssht\Messages;
13 
17 class IGNORE implements MessageInterface
18 {
20  protected $data;
21 
28  public function __construct($data)
29  {
30  if (!is_string($data)) {
31  throw new \InvalidArgumentException();
32  }
33 
34  $this->data = $data;
35  }
36 
37  public static function getMessageId()
38  {
39  return 2;
40  }
41 
42  public function serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
43  {
44  $encoder->encodeString($this->data);
45  return $this;
46  }
47 
48  public static function unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
49  {
50  return new static($decoder->decodeString());
51  }
52 
59  public function getData()
60  {
61  return $this->data;
62  }
63 }
serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
Definition: IGNORE.php:42
static unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
Definition: IGNORE.php:48
$data
Payload for the ignore message.
Definition: IGNORE.php:20