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 = []) |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | 3 | public function getCurrentUrl() |
|
89 | |||
90 | /** |
||
91 | * Drop known LinkedIn params. Ie those in self::$knownLinkeInParams. |
||
92 | * |
||
93 | * @param string $query |
||
94 | * |
||
95 | * @return string query without LinkedIn params. This string is prepended with a question mark '?' |
||
96 | */ |
||
97 | 1 | protected function dropLinkedInParams($query) |
|
122 | |||
123 | /** |
||
124 | * Get the host. |
||
125 | * |
||
126 | * |
||
127 | * @return mixed |
||
128 | */ |
||
129 | 2 | protected function getHttpHost() |
|
137 | |||
138 | /** |
||
139 | * Get the protocol. |
||
140 | * |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | 4 | protected function getHttpProtocol() |
|
168 | |||
169 | /** |
||
170 | * {@inheritdoc} |
||
171 | */ |
||
172 | 3 | public function setTrustForwarded($trustForwarded) |
|
178 | } |
||
179 |