| 1 | <?php | ||
| 7 | final class InMemoryLocation implements Location | ||
| 8 | { | ||
| 9 | /** | ||
| 10 | * @var string | ||
| 11 | */ | ||
| 12 | private $host; | ||
| 13 | |||
| 14 | /** | ||
| 15 | * @var int | ||
| 16 | */ | ||
| 17 | private $port; | ||
| 18 | |||
| 19 | /** | ||
| 20 | * @param string $host | ||
| 21 | * @param int $port | ||
| 22 | */ | ||
| 23 | public function __construct($host, $port) | ||
| 28 | |||
| 29 | /** | ||
| 30 | * @inheritdoc | ||
| 31 | * | ||
| 32 | * @return string | ||
| 33 | */ | ||
| 34 | public function getHost() | ||
| 38 | |||
| 39 | /** | ||
| 40 | * @inheritdoc | ||
| 41 | * | ||
| 42 | * @return int | ||
| 43 | */ | ||
| 44 | public function getPort() | ||
| 48 | |||
| 49 | /** | ||
| 50 | * @inheritdoc | ||
| 51 | * | ||
| 52 | * @return string | ||
| 53 | */ | ||
| 54 | public function serialize() | ||
| 55 |     { | ||
| 56 | return serialize([ | ||
| 57 | "host" => $this->host, | ||
| 58 | "port" => $this->port, | ||
| 59 | ]); | ||
| 60 | } | ||
| 61 | |||
| 62 | /** | ||
| 63 | * @inheritdoc | ||
| 64 | * | ||
| 65 | * @param string $serialized | ||
| 66 | */ | ||
| 67 | public function unserialize($serialized) | ||
| 74 | } | ||
| 75 |