Skip to content

Commit

Permalink
Updating the contract and doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Feb 7, 2017
1 parent 1e4715e commit 43bf2c3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -155,6 +162,8 @@ public function device($userAgent = null)
}

/**
* Get the browser name.
*
* @param string|null $userAgent
*
* @return string
Expand Down Expand Up @@ -190,6 +199,8 @@ public function robot($userAgent = null)
}

/**
* Get the platform name.
*
* @param string|null $userAgent
*
* @return string
Expand All @@ -206,6 +217,7 @@ public function platform($userAgent = null)
}

/**
* Get the languages.
*
* @param string|null $acceptLanguage
*
Expand Down
45 changes: 45 additions & 0 deletions src/Contracts/Agent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43bf2c3

Please sign in to comment.