1 | <?php |
||
8 | class UrlGenerator implements UrlGeneratorInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var array knownLinkedInParams |
||
12 | * |
||
13 | * A list of params that might be in the query string |
||
14 | */ |
||
15 | public static $knownLinkedInParams = ['state', 'code', 'access_token', 'user']; |
||
16 | |||
17 | /** |
||
18 | * @var array domainMap |
||
19 | * |
||
20 | * Maps aliases to LinkedIn domains. |
||
21 | */ |
||
22 | public static $domainMap = [ |
||
23 | 'api' => 'https://api.linkedin.com/', |
||
24 | 'www' => 'https://www.linkedin.com/', |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * @var bool |
||
29 | * |
||
30 | * Indicates if we trust HTTP_X_FORWARDED_* headers. |
||
31 | */ |
||
32 | protected $trustForwarded = false; |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 2 | public function getUrl($name, $path = '', $params = []) |
|
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | 3 | public function getCurrentUrl() |
|
100 | |||
101 | /** |
||
102 | * Drop known LinkedIn params. Ie those in self::$knownLinkeInParams. |
||
103 | * |
||
104 | * @param string $query |
||
105 | * |
||
106 | * @return string query without LinkedIn params. This string is prepended with a question mark '?' |
||
107 | */ |
||
108 | 1 | protected function dropLinkedInParams($query) |
|
133 | |||
134 | /** |
||
135 | * Get the host. |
||
136 | * |
||
137 | * |
||
138 | * @return mixed |
||
139 | */ |
||
140 | 2 | protected function getHttpHost() |
|
148 | |||
149 | /** |
||
150 | * Get the protocol. |
||
151 | * |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | 4 | protected function getHttpProtocol() |
|
179 | |||
180 | /** |
||
181 | * {@inheritdoc} |
||
182 | */ |
||
183 | 3 | public function setTrustForwarded($trustForwarded) |
|
189 | } |
||
190 |