Skip to content

Commit 926dca4

Browse files
feat(device): Add device detection functionality
1 parent d3cde8e commit 926dca4

File tree

1 file changed

+32
-13
lines changed

1 file changed

+32
-13
lines changed

src/Identify.php

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,30 @@
22

33
namespace Unicodeveloper\Identify;
44

5-
use Sinergi\BrowserDetector\Browser;
65
use Sinergi\BrowserDetector\Os;
6+
use Sinergi\BrowserDetector\Device;
7+
use Sinergi\BrowserDetector\Browser;
78
use Sinergi\BrowserDetector\Language;
89

910
class Identify {
1011

1112
/**
12-
* Store the browser object
13+
* Store the os object
1314
* @var object
1415
*/
15-
protected $browser;
16+
protected $os;
1617

1718
/**
18-
* Store the os object
19+
* Store the device object
1920
* @var object
2021
*/
21-
protected $os;
22+
protected $device;
23+
24+
/**
25+
* Store the browser object
26+
* @var object
27+
*/
28+
protected $browser;
2229

2330
/**
2431
* Store the language object
@@ -32,28 +39,40 @@ class Identify {
3239
public function __construct()
3340
{
3441
$this->os = new Os();
42+
$this->device = new Device();
3543
$this->browser = new Browser();
3644
$this->language = new Language();
45+
3746
}
3847

3948
/**
40-
* Get all the methods applicable to browser detection
49+
* Get all the methods applicable to Os detection
4150
* e.g getName(), getVersion()
42-
* @return \Sinergi\BrowserDetector\Browser
51+
* @return \Sinergi\BrowserDetector\Os
4352
*/
44-
public function browser()
53+
public function os()
4554
{
46-
return $this->browser;
55+
return $this->os;
4756
}
4857

4958
/**
50-
* Get all the methods applicable to Os detection
59+
* Get all the methods applicable to Device detection
60+
* e.g getName()
61+
* @return \Sinergi\BrowserDetector\Device
62+
*/
63+
public function device()
64+
{
65+
return $this->device;
66+
}
67+
68+
/**
69+
* Get all the methods applicable to Browser detection
5170
* e.g getName(), getVersion()
52-
* @return \Sinergi\BrowserDetector\Os
71+
* @return \Sinergi\BrowserDetector\Browser
5372
*/
54-
public function os()
73+
public function browser()
5574
{
56-
return $this->os;
75+
return $this->browser;
5776
}
5877

5978
/**

0 commit comments

Comments
 (0)