| Total Complexity | 6 |
| Total Lines | 80 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class Url implements \Serializable |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string |
||
| 9 | */ |
||
| 10 | protected $location; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $providerName; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | protected $options; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Url constructor. |
||
| 24 | * |
||
| 25 | * @param string $location |
||
| 26 | * @param string $providerName |
||
| 27 | * @param array $options |
||
| 28 | */ |
||
| 29 | public function __construct(string $location, string $providerName, array $options = []) |
||
| 30 | { |
||
| 31 | $this->location = $location; |
||
| 32 | $this->providerName = $providerName; |
||
| 33 | $this->options = $options; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function serialize(): string |
||
| 41 | ]); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Constructs the object. |
||
| 46 | * |
||
| 47 | * @see https://php.net/manual/en/serializable.unserialize.php |
||
| 48 | * |
||
| 49 | * @param string $serialized <p> |
||
| 50 | * The string representation of the object. |
||
| 51 | * </p> |
||
| 52 | * |
||
| 53 | * @since 5.1.0 |
||
| 54 | */ |
||
| 55 | public function unserialize($serialized) |
||
| 56 | { |
||
| 57 | $data = unserialize($serialized); |
||
| 58 | |||
| 59 | $this->location = $data['location']; |
||
| 60 | $this->providerName = $data['providerName']; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | public function getLocation(): string |
||
| 67 | { |
||
| 68 | return $this->location; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @return string |
||
| 73 | */ |
||
| 74 | public function getProviderName(): string |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @return array |
||
| 81 | */ |
||
| 82 | public function getOptions(): array |
||
| 87 |