jooservices / useragent
Deterministic, dataset-backed synthetic User-Agent profiles for tests and fixtures.
v4.0.0
2026-09-09 17:17 UTC
Requires
- php: >=8.5
- ext-json: *
- jooservices/dto: ^3.0
Requires (Dev)
- captainhook/captainhook: ^5.23
- captainhook/plugin-composer: ^5.3
- friendsofphp/php-cs-fixer: ^3.65
- laravel/pint: ^1.18
- phpmd/phpmd: ^2.15
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^13.0
- squizlabs/php_codesniffer: ^3.12 || ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-21 09:31:21 UTC
README
PHP 8.5+ deterministic generator of coherent synthetic browser User-Agent profiles for tests, fixtures, and controlled client configuration.
Features
- Checksummed bundled dataset with provenance on every result
- Seeded, weighted, uniform, and round-robin profile selection
- Immutable fluent request builder and bounded unique batch generation
generatePool()for a list of ready-to-use User-Agent strings- Stable profile identity for logs and fixtures
- Non-interactive CLI with JSON and NDJSON output
Requirements
- PHP
>= 8.5 ext-jsonjooservices/dto ^3.0
Installation
composer require jooservices/useragent:^4.0
Quick start
use JOOservices\UserAgent\Generator; $generator = Generator::create(); $pool = $generator->builder() ->chrome() ->windows() ->desktop() ->seed(42) ->generatePool(10);
Design notes
- Reuse one
Generatorinstance in long-running processes; it loads and validates the bundled dataset once. - A User-Agent string is synthetic metadata, not browser emulation.
- The package performs no network access and does not accept a caller-provided dataset path.
Documentation
Development
make build
make install
make lint
make test
make ci
Community
License
MIT — see LICENSE.