1 | <?php |
||
17 | class Url extends Endpoint |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Scheme part of url |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | private $scheme; |
||
26 | |||
27 | /** |
||
28 | * Path part of url |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | private $path; |
||
33 | |||
34 | /** |
||
35 | * The query string |
||
36 | */ |
||
37 | private $queryString; |
||
38 | |||
39 | /** |
||
40 | * Create a new Url instance |
||
41 | * |
||
42 | * @param string $address |
||
43 | * The address for the url (either only address or full url) |
||
44 | * @param int $port |
||
45 | * The port for the url |
||
46 | * @param string $path |
||
47 | * The path for the url |
||
48 | * @param string $scheme |
||
49 | * The scheme for the url |
||
50 | */ |
||
51 | 35 | public function __construct($address, $port = 80, $path = '/', $scheme = 'http', $queryString = '') |
|
66 | |||
67 | /** |
||
68 | * Get the scheme of the url |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | 23 | public function getScheme(): string |
|
76 | |||
77 | /** |
||
78 | * Get the path of the url |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | 32 | public function getPath(): string |
|
86 | |||
87 | /** |
||
88 | * Retrieve the url as string |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | 6 | public function getUrlString(): string |
|
104 | |||
105 | /** |
||
106 | * Retrieve only the file part |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getFile(): string |
||
114 | |||
115 | 31 | public function getQueryString(): string |
|
119 | |||
120 | /** |
||
121 | * |
||
122 | * {@inheritdoc} |
||
123 | * @see \Generics\Socket\Endpoint::__toString() |
||
124 | */ |
||
125 | 4 | public function __toString(): string |
|
129 | } |
||
130 |