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