From 43bf2c3a236d0f2664ec656c475c91cbae5357fc Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Tue, 7 Feb 2017 12:55:05 +0000 Subject: [PATCH] Updating the contract and doc comments --- src/Agent.php | 12 +++++++++++ src/Contracts/Agent.php | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/src/Agent.php b/src/Agent.php index 71d1e2c..fa90918 100644 --- a/src/Agent.php +++ b/src/Agent.php @@ -141,6 +141,13 @@ public function getRules() : parent::getRules(); } + /** + * Get the device name. + * + * @param string|null $userAgent + * + * @return string + */ public function device($userAgent = null) { // Get device rules @@ -155,6 +162,8 @@ public function device($userAgent = null) } /** + * Get the browser name. + * * @param string|null $userAgent * * @return string @@ -190,6 +199,8 @@ public function robot($userAgent = null) } /** + * Get the platform name. + * * @param string|null $userAgent * * @return string @@ -206,6 +217,7 @@ public function platform($userAgent = null) } /** + * Get the languages. * * @param string|null $acceptLanguage * diff --git a/src/Contracts/Agent.php b/src/Contracts/Agent.php index 26d2a81..2d4fd03 100644 --- a/src/Contracts/Agent.php +++ b/src/Contracts/Agent.php @@ -46,6 +46,51 @@ public function setHttpHeaders($httpHeaders = null); */ public function version($propertyName, $type = Mobile_Detect::VERSION_TYPE_STRING); + /** + * Get the device name. + * + * @param string|null $userAgent + * + * @return string + */ + public function device($userAgent = null); + + /** + * Get the browser name. + * + * @param string|null $userAgent + * + * @return string + */ + public function browser($userAgent = null); + + /** + * Get the robot name. + * + * @param string|null $userAgent + * + * @return string + */ + public function robot($userAgent = null); + + /** + * Get the platform name. + * + * @param string|null $userAgent + * + * @return string + */ + public function platform($userAgent = null); + + /** + * Get the languages. + * + * @param string|null $acceptLanguage + * + * @return array + */ + public function languages($acceptLanguage = null); + /** * Check if the device is mobile. * Returns true if any type of mobile device detected, including special ones