PHPackages                             danog/advanced-json-rpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. danog/advanced-json-rpc

ActiveLibrary[API Development](/categories/api)

danog/advanced-json-rpc
=======================

A more advanced JSONRPC implementation

v3.2.3(4mo ago)136.7M—2.8%2[4 PRs](https://github.com/danog/php-advanced-json-rpc/pulls)3ISCPHPPHP &gt;=8.1CI failing

Since Aug 24Pushed 1w ago1 watchersCompare

[ Source](https://github.com/danog/php-advanced-json-rpc)[ Packagist](https://packagist.org/packages/danog/advanced-json-rpc)[ RSS](/packages/danog-advanced-json-rpc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (33)Used By (3)

Advanced JSONRPC
================

[](#advanced-jsonrpc)

[![Version](https://camo.githubusercontent.com/ebcedca911a7702a812b86672c25a7073610b6e63e17ea99ba9a07defab906b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616e6f672f616476616e6365642d6a736f6e2d7270632e737667)](https://packagist.org/packages/danog/advanced-json-rpc)[![Coverage](https://camo.githubusercontent.com/9676aece4a557cb72001efe0e6dd109fe64c70859ef879b01b9db804329ac1bf/68747470733a2f2f636f6465636f762e696f2f67682f64616e6f672f7068702d616476616e6365642d6a736f6e2d7270632f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/danog/php-advanced-json-rpc)[![semantic-release](https://camo.githubusercontent.com/5f3b57745af83409bc673dec57e3eb360e1ec53b37ac29f81a319e347fa351c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2532302532302546302539462539332541362546302539462539412538302d73656d616e7469632d2d72656c656173652d6531303037392e737667)](https://github.com/semantic-release/semantic-release)[![License](https://camo.githubusercontent.com/4599848cf833e17fb86c3617ae630e935737b17a52876b8466bb6453e4ddbf6b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64616e6f672f616476616e6365642d6a736f6e2d7270632e737667)](https://github.com/danog/php-advanced-json-rpc/blob/master/LICENSE)

Provides basic classes for requests and responses in JSONRPC and a `Dispatcher` class that can decode a JSONRPC request and call appropriate methods on a target, coercing types of parameters by type-hints and `@param` tags.

Supports nested targets: If the method is something like `myNestedTarget->theMethod`, the dispatcher will look for a `myNestedTarget` property on the target and call `theMethod` on it. The delimiter is configurable and defaults to the PHP object operator `->`.

Example
-------

[](#example)

```
use AdvancedJsonRpc\Dispatcher;

class Argument
{
    public $aProperty;
}

class Target
{
    public function someMethod(Argument $arg)
    {
        // $arg instanceof Argument === true
        // $arg->aProperty === 123
        return 'Hello World';
    }
}

$dispatcher = new Dispatcher(new Target());

$result = $dispatcher->dispatch('
    {
        "jsonrpc": "2.0",
        "id": 1,
        "method": "someMethod",
        "params": {
            "arg": {"aProperty": 123}
        }
    }
');

// $result === "Hello World"
```

### Nested Targets

[](#nested-targets)

```
use AdvancedJsonRpc\Dispatcher;

class TextDocumentManager
{
    public function didOpen(string $uri)
    {
        return 'Thank you for this information';
    }
}

class LanguageServer
{
    public $textDocument;

    public function __construct()
    {
        $this->textDocument = new TextDocumentManager();
    }
}

$dispatcher = new Dispatcher(new LanguageServer(), '/');

$result = $dispatcher->dispatch('
    {
        "jsonrpc": "2.0",
        "id": 1,
        "method": "textDocument/didOpen",
        "params": {
            "uri": "file:///c/Users/felix/test.php"
        }
    }
');

// $result === "Thank you for this information"
```

###  Health Score

67

—

FairBetter than 100% of packages

Maintenance89

Actively maintained with recent releases

Popularity53

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~122 days

Recently: every ~457 days

Total

29

Last Release

126d ago

Major Versions

v1.2.10 → v2.0.02016-10-20

v2.0.3 → v3.0.02017-10-23

PHP version history (3 changes)v1.0.0PHP &gt;=7.0

v3.2.0PHP ^7.1 || ^8.0

v3.2.2PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1586cd637028e4f8da85f2252b8f4b81e05f6b17a93f92c34ff064dd838e6bb?d=identicon)[danog](/maintainers/danog)

---

Top Contributors

[![felixfbecker](https://avatars.githubusercontent.com/u/10532611?v=4)](https://github.com/felixfbecker "felixfbecker (41 commits)")[![danog](https://avatars.githubusercontent.com/u/7339644?v=4)](https://github.com/danog "danog (24 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")[![TysonAndre](https://avatars.githubusercontent.com/u/1904430?v=4)](https://github.com/TysonAndre "TysonAndre (3 commits)")[![Lctrs](https://avatars.githubusercontent.com/u/5477973?v=4)](https://github.com/Lctrs "Lctrs (1 commits)")[![muglug](https://avatars.githubusercontent.com/u/2292638?v=4)](https://github.com/muglug "muglug (1 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (1 commits)")[![tanderson-tns](https://avatars.githubusercontent.com/u/235535224?v=4)](https://github.com/tanderson-tns "tanderson-tns (1 commits)")[![umesecke](https://avatars.githubusercontent.com/u/36171?v=4)](https://github.com/umesecke "umesecke (1 commits)")[![VincentLanglet](https://avatars.githubusercontent.com/u/9052536?v=4)](https://github.com/VincentLanglet "VincentLanglet (1 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (1 commits)")[![a-menshchikov](https://avatars.githubusercontent.com/u/2580489?v=4)](https://github.com/a-menshchikov "a-menshchikov (1 commits)")[![weirdan](https://avatars.githubusercontent.com/u/57403?v=4)](https://github.com/weirdan "weirdan (1 commits)")[![DannyvdSluijs](https://avatars.githubusercontent.com/u/618940?v=4)](https://github.com/DannyvdSluijs "DannyvdSluijs (1 commits)")[![gnoe](https://avatars.githubusercontent.com/u/15986235?v=4)](https://github.com/gnoe "gnoe (1 commits)")[![JJK96](https://avatars.githubusercontent.com/u/11193274?v=4)](https://github.com/JJK96 "JJK96 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/danog-advanced-json-rpc/health.svg)

```
[![Health](https://phpackages.com/badges/danog-advanced-json-rpc/health.svg)](https://phpackages.com/packages/danog-advanced-json-rpc)
```

###  Alternatives

[felixfbecker/advanced-json-rpc

A more advanced JSONRPC implementation

25578.7M6](/packages/felixfbecker-advanced-json-rpc)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[thecodingmachine/graphqlite

Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).

5723.1M30](/packages/thecodingmachine-graphqlite)[overblog/graphql-bundle

This bundle provides tools to build a GraphQL server in your Symfony App.

8027.9M28](/packages/overblog-graphql-bundle)[api-platform/api-pack

A pack for API Platform

5236.7M40](/packages/api-platform-api-pack)[dingo/blueprint

API Blueprint documentation generator.

2707.8M22](/packages/dingo-blueprint)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
