Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 17, 2024 via composer

felixfbecker/advanced-json-rpc v3.2.1

A more advanced JSONRPC implementation
Package summary
Share
1
issue
1
high severity
license
1
3
licenses
6
MIT
1
ISC
1
OSL-3.0
Package created
24 Aug 2016
Version published
11 Jun 2021
Maintainers
1
Total deps
8
Direct deps
2
License
ISC

Issues

1

1 high severity issue

high
Recommendation: Validate that the package complies with your license policy
via: netresearch/jsonmapper@v4.4.1
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
6 Packages, Including:
doctrine/deprecations@1.1.3
phpdocumentor/reflection-common@2.2.0
phpdocumentor/reflection-docblock@5.4.0
phpdocumentor/type-resolver@1.8.2
phpstan/phpdoc-parser@1.29.0
webmozart/assert@1.11.0

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
felixfbecker/advanced-json-rpc@v3.2.1

Open Software License 3.0

Strongly Protective
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
sublicense
modify
distribute
commercial-use
Cannot
use-trademark
hold-liable
Must
disclose-source
include-copyright
include-license
1 Packages, Including:
netresearch/jsonmapper@v4.4.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of felixfbecker/advanced-json-rpc 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
netresearch/jsonmapperv4.4.1-OSL-3.0
prod
1
phpdocumentor/reflection-docblock5.4.0-MIT
prod

Visualizations

Frequently Asked Questions

What does felixfbecker/advanced-json-rpc do?

The felixfbecker/advanced-json-rpc is an advanced implementation of JSON RPC (Remote Procedure Call) in PHP. This composer package provides basic classes for setting up requests and responses in JSONRPC. One of its standout features is its Dispatcher class, which can decode a JSONRPC request and call the appropriate methods on a target while coercing the types of parameters by type-hints and @param tags. It supports nested targets, thus allowing for complex function calls.

How do you use felixfbecker/advanced-json-rpc?

To use the felixfbecker/advanced-json-rpc package in your PHP project, you will first need to install it via composer. Below is an example of how you can incorporate the package in your code:

use AdvancedJsonRpc\Dispatcher;

class Argument 
{
    public $aProperty;
}

class Target
{
    public function someMethod(Argument $arg)
    {
        return 'Hello World';
    }
}

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

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

In the above example, an instance of the Dispatcher class is created with a Target object as the target. The Dispatcher then decodes a JSONRPC request and calls the appropriate method on the target.

It's also possible to handle nested targets as shown below:

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"
        }
    }
');

In this case, the method didOpen in the TextDocumentManager class nested inside the LanguageServer class is called.

Where are the felixfbecker/advanced-json-rpc docs?

The official documentation for the felixfbecker/advanced-json-rpc package is available on the GitHub repository felixfbecker/php-advanced-json-rpc. The README file in the repository provides all the necessary information about the installation and how to use the package, including code examples. If you are looking to integrate advanced JSONRpc into your PHP project, this should be your primary resource.