Skip to content

Commit 76bd67d

Browse files
feat(package): Add language, os and browser methods
1 parent 470277d commit 76bd67d

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

src/Identify.php

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,66 @@
33
namespace Unicodeveloper\Identify;
44

55
use Sinergi\BrowserDetector\Browser;
6+
use Sinergi\BrowserDetector\Os;
7+
use Sinergi\BrowserDetector\Language;
68

79
class Identify {
810

11+
/**
12+
* Store the browser object
13+
* @var object
14+
*/
15+
protected $browser;
16+
17+
/**
18+
* Store the os object
19+
* @var object
20+
*/
21+
protected $os;
22+
23+
/**
24+
* Store the language object
25+
* @var object
26+
*/
27+
protected $language;
28+
29+
/**
30+
* Create an Instance of Browser and Os
31+
*/
932
public function __construct()
1033
{
34+
$this->os = new Os();
1135
$this->browser = new Browser();
36+
$this->language = new Language();
1237
}
1338

39+
/**
40+
* Get all the methods applicable to browser detection
41+
* e.g getName(), getVersion()
42+
* @return \Sinergi\BrowserDetector\Browser
43+
*/
1444
public function browser()
1545
{
16-
return $this->browser->getName();
46+
return $this->browser;
47+
}
48+
49+
/**
50+
* Get all the methods applicable to Os detection
51+
* e.g getName(), getVersion()
52+
* @return \Sinergi\BrowserDetector\Os
53+
*/
54+
public function os()
55+
{
56+
return $this->os;
1757
}
58+
59+
/**
60+
* Get all the methods applicable to Language detection
61+
* @return \Sinergi\BrowserDetector\Language
62+
*/
63+
public function lang()
64+
{
65+
return $this->language;
66+
}
67+
1868
}

0 commit comments

Comments
 (0)