| @@ 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. |
|
| @@ 84-93 (lines=10) @@ | ||
| 81 | * |
|
| 82 | * @throws \Sinergi\BrowserDetector\InvalidArgumentException |
|
| 83 | */ |
|
| 84 | public function __construct($userAgent = null) |
|
| 85 | { |
|
| 86 | if ($userAgent instanceof UserAgent) { |
|
| 87 | $this->setUserAgent($userAgent); |
|
| 88 | } elseif (null === $userAgent || is_string($userAgent)) { |
|
| 89 | $this->setUserAgent(new UserAgent($userAgent)); |
|
| 90 | } else { |
|
| 91 | throw new InvalidArgumentException(); |
|
| 92 | } |
|
| 93 | } |
|
| 94 | ||
| 95 | /** |
|
| 96 | * Set the name of the OS. |
|