| @@ 28-37 (lines=10) @@ | ||
| 25 | * |
|
| 26 | * @throws \Sinergi\BrowserDetector\InvalidArgumentException |
|
| 27 | */ |
|
| 28 | public function __construct($userAgent = null) |
|
| 29 | { |
|
| 30 | if ($userAgent instanceof UserAgent) { |
|
| 31 | $this->setUserAgent($userAgent); |
|
| 32 | } elseif (null === $userAgent || is_string($userAgent)) { |
|
| 33 | $this->setUserAgent(new UserAgent($userAgent)); |
|
| 34 | } else { |
|
| 35 | throw new InvalidArgumentException(); |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * @param UserAgent $userAgent |
|
| @@ 56-65 (lines=10) @@ | ||
| 53 | * |
|
| 54 | * @throws \Sinergi\BrowserDetector\InvalidArgumentException |
|
| 55 | */ |
|
| 56 | public function __construct($userAgent = null) |
|
| 57 | { |
|
| 58 | if ($userAgent instanceof UserAgent) { |
|
| 59 | $this->setUserAgent($userAgent); |
|
| 60 | } elseif (null === $userAgent || is_string($userAgent)) { |
|
| 61 | $this->setUserAgent(new UserAgent($userAgent)); |
|
| 62 | } else { |
|
| 63 | throw new InvalidArgumentException(); |
|
| 64 | } |
|
| 65 | } |
|
| 66 | ||
| 67 | /** |
|
| 68 | * Return the name of the OS. |
|
| @@ 80-89 (lines=10) @@ | ||
| 77 | */ |
|
| 78 | private $url; |
|
| 79 | ||
| 80 | public function __construct($userAgent = null) |
|
| 81 | { |
|
| 82 | if ($userAgent instanceof UserAgent) { |
|
| 83 | $this->setUserAgent($userAgent); |
|
| 84 | } elseif (null === $userAgent || is_string($userAgent)) { |
|
| 85 | $this->setUserAgent(new UserAgent($userAgent)); |
|
| 86 | } else { |
|
| 87 | throw new InvalidArgumentException(); |
|
| 88 | } |
|
| 89 | } |
|
| 90 | ||
| 91 | /** |
|
| 92 | * Set the name of the ScriptedAgent. |
|
| @@ 93-102 (lines=10) @@ | ||
| 90 | * @param null|string|UserAgent $userAgent |
|
| 91 | * @throws \Sinergi\BrowserDetector\InvalidArgumentException |
|
| 92 | */ |
|
| 93 | public function __construct($userAgent = null) |
|
| 94 | { |
|
| 95 | if ($userAgent instanceof UserAgent) { |
|
| 96 | $this->setUserAgent($userAgent); |
|
| 97 | } elseif (null === $userAgent || is_string($userAgent)) { |
|
| 98 | $this->setUserAgent(new UserAgent($userAgent)); |
|
| 99 | } else { |
|
| 100 | throw new InvalidArgumentException(); |
|
| 101 | } |
|
| 102 | } |
|
| 103 | ||
| 104 | /** |
|
| 105 | * Set the name of the Browser. |
|