otis22 / reverso
Library for working with reverso context api
Requires
- ext-json: *
- elegant-bro/interfaces: ^1.2
- guzzlehttp/guzzle: >6.0
Requires (Dev)
- otis22/php-coverage-checker: ^1.2
- phpstan/phpstan: ^0.12.19
- phpunit/phpunit: ^9.1
- symplify/easy-coding-standard: ^9.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Library for working with context.reverso.net api
How to use
composer require otis22/reverso
Be careful library can translate only one a single word
Available language list: en, fr, es, de, it, pt, ru, ro, cz, zh
use Otis22\Reverso\Context; $context = Context::fromLanguagesAndWord("ru", "en", "пример"); $context->original(); # return "пример" $context->firstInDictionary(); # return "example" word, because it is the most popular variant in the reverso.net $context->dictionary(); #return synonyms array ['example', 'sample', 'case', ...] $context->examples(); #return examples sentences /** [ [ 'source' => 'Красивый <em>пример</em> - прошлогодняя эпидемия свиного гриппа.', 'target' => 'So a nice <em>example</em> of this came from last year and swine flu.' ], ... ] */
Contributing
The development queue and acceptance criteria are in Roadmap.md and
Tasks.md. Agent instructions are in AGENTS.md.
Non-trivial changes get a short proposal in PRD/ before implementation.
For all local checks
make all
or connect to terminal
make exec
Dafault php version is 7.4. Use PHP_VERSION= for using custom version.
make all PHP_VERSION=8.0 # run both make all PHP_VERSION=7.4 && make all PHP_VERSION=8.0
make all builds the Docker image, installs dependencies, runs ECS and PHPStan,
then the local unit suite and the 90% coverage check. composer unit and CI run
the same unit suite. To check the live Reverso service separately, run
make integration PHP_VERSION=7.4 (or composer integration after install).
The integration command reports the real service failure; on 2026-10-24 the
service's Cloudflare challenge returned HTTP 403 from this machine.
The PHP support range is not declared in composer.json; see the roadmap
before changing PHP or dependencies.
all commands
# composer install make install # composer install with --no-dev make install-no-dev # check code style make style # fix code style make style-fix # run static analyze tools make static-analyze # run unit tests make unit # check the live Reverso service make integration # check coverage make coverage