1 | <?php |
||
9 | class Url { |
||
10 | |||
11 | protected $parsedUrl; |
||
12 | |||
13 | /** |
||
14 | * Url constructor. |
||
15 | * @param $url |
||
16 | * @param array $parameters |
||
17 | * @throws \Throwable |
||
18 | */ |
||
19 | public function __construct($url, $parameters = []) { |
||
42 | |||
43 | /** |
||
44 | * Get the scheme of this url or an empty string if unset. |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | public function scheme() { |
||
51 | |||
52 | /** |
||
53 | * Get the host of this url or an empty string if unset. |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function host() { |
||
60 | |||
61 | /** |
||
62 | * Get the port of this url or an empty string if unset. |
||
63 | * |
||
64 | * @return string |
||
65 | */ |
||
66 | public function port() { |
||
69 | |||
70 | /** |
||
71 | * Get the user of this url or an empty string if unset. |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public function user() { |
||
78 | |||
79 | /** |
||
80 | * Get the pass of this url or an empty string if unset. |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | public function pass() { |
||
87 | |||
88 | /** |
||
89 | * Get the path of this url or an empty string if unset. |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | public function path() { |
||
96 | |||
97 | /** |
||
98 | * Retrieve a query string item from the request. |
||
99 | * |
||
100 | * @param string $key |
||
101 | * @param string $default |
||
102 | * @return string|array|null |
||
103 | */ |
||
104 | public function query($key = null, $default = null) { |
||
119 | |||
120 | /** |
||
121 | * Get the fragment of this url or an empty string if unset. |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | public function fragment() { |
||
128 | |||
129 | /** |
||
130 | * Obtain a string made out of this Url. |
||
131 | * |
||
132 | * @param bool $withQuery |
||
133 | * @return string |
||
134 | */ |
||
135 | public function get($withQuery = true) { |
||
149 | |||
150 | /** |
||
151 | * Obtain a string made out of this Url without queries. |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | public function getWithoutQuery() { |
||
158 | |||
159 | /** |
||
160 | * To string magic function, automatically called when casting to string. |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | public function __toString() { |
||
167 | } |
||
168 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.