mikeevstropov / user-agent
The library provides a user agent string
Installs: 81
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mikeevstropov/user-agent
Requires
- php: >=5.4
Requires (Dev)
- php: >=5.6
- phpunit/phpunit: ^5.7
- webmozart/assert: ^1.2
This package is not auto-updated.
Last update: 2022-09-03 17:23:12 UTC
README
The library provides a user agent string
Installation
Add dependency mikeevstropov/user-agent
$ composer require mikeevstropov/user-agent
Usage
<?php use Mikeevstropov\UserAgent\UserAgent; // Getting of a desktop user agent $desktopUserAgent = UserAgent::getDesktopRand(); gettype($desktopUserAgent); // string // Getting of a mobile user agent $mobileUserAgent = UserAgent::getMobileRand(); gettype($mobileUserAgent); // string
Api Interface
-
getDesktopRand
Get a random desktop user agent
Returns:
string
-
getMobileRand
Get a random mobile user agent
Returns:
string
Development
Clone
$ git clone https://github.com/mikeevstropov/user-agent
Go to project
$ cd user-agent
Install dependencies
$ composer install
Run the tests
$ composer test
License
MIT