Last active
December 15, 2015 10:19
-
-
Save MirkoBonadei/5245188 to your computer and use it in GitHub Desktop.
Device-class-before
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Device | |
{ | |
private $userAgent; | |
private $kind; | |
private $os; | |
private $devicesDatabase; | |
public function __construct($userAgent, $devicesDatabase) | |
{ | |
$this->userAgent = $userAgent; | |
$this->devicesDatabase = $devicesDatabase; | |
} | |
public function os() | |
{ | |
// some code to retrieve OS from $this->devicesDatabase | |
} | |
public function kind() | |
{ | |
// some code to retrieve the kind of the Device from $this->devicesDatabase | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment