| 1 | <?php |
||
| 9 | final class Support implements SupportInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | private $source = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The HTTP Headers that this application will look through to find the best |
||
| 18 | * User Agent, if one is not specified |
||
| 19 | * |
||
| 20 | * @var array |
||
| 21 | */ |
||
| 22 | private $userAgentHeaders = [ |
||
| 23 | 'HTTP_X_DEVICE_USER_AGENT', |
||
| 24 | 'HTTP_X_ORIGINAL_USER_AGENT', |
||
| 25 | 'HTTP_X_OPERAMINI_PHONE_UA', |
||
| 26 | 'HTTP_X_SKYFIRE_PHONE', |
||
| 27 | 'HTTP_X_BOLT_PHONE_UA', |
||
| 28 | 'HTTP_USER_AGENT', |
||
| 29 | ]; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param array|null $source |
||
| 33 | */ |
||
| 34 | 2 | public function __construct(?array $source = null) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * detect the useragent |
||
| 45 | * |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | 2 | public function getUserAgent() : string |
|
| 64 | |||
| 65 | /** |
||
| 66 | * clean Parameters taken from GET or POST Variables |
||
| 67 | * |
||
| 68 | * @param string $param the value to be cleaned |
||
| 69 | * |
||
| 70 | * @return string |
||
| 71 | */ |
||
| 72 | 1 | private function cleanParam(string $param) : string |
|
| 76 | } |
||
| 77 |