{"id":18832646,"url":"https://github.com/datto/php-json-rpc-simple","last_synced_at":"2025-04-14T04:24:21.664Z","repository":{"id":56963098,"uuid":"47975887","full_name":"datto/php-json-rpc-simple","owner":"datto","description":"Request-to-class mapping extension for the JSON-RPC library ","archived":false,"fork":false,"pushed_at":"2016-04-06T16:17:44.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T18:21:25.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-14T13:12:02.000Z","updated_at":"2022-11-02T20:26:28.000Z","dependencies_parsed_at":"2022-08-21T08:20:54.882Z","dependency_job_id":null,"html_url":"https://github.com/datto/php-json-rpc-simple","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fphp-json-rpc-simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fphp-json-rpc-simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fphp-json-rpc-simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fphp-json-rpc-simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datto","download_url":"https://codeload.github.com/datto/php-json-rpc-simple/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675980,"owners_count":21143849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T01:58:36.428Z","updated_at":"2025-04-14T04:24:21.639Z","avatar_url":"https://github.com/datto.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON-RPC Simple Mapper\n\nThis is a request-to-class mapping extension for the [php-json-rpc](https://github.com/datto/php-json-rpc) library. Its purpose is to eliminate the need to write manual mapping functions for API endpoints by providing an automatic mapping of the JSON-RPC `method` and `params` arguments to a matching PHP class, method and parameters.\n\nExamples\n--------\nFirst write an API end point:\n\n```php\n\u003c?php\n\nnamespace Datto\\API;\n\nclass Math\n{\n    public function subtract($a, $b)\n    {\n        return $a - $b;\n    }\n}\n```\n\nThen use the API (with the default namespace `Datto\\API`):\n\n```php\n// This will instantiate an object of the type `Datto\\API\\Math`,\n// call the `subtract` method, and return a corresponding JSON-RPC response.\n\n$server = new Server(new Simple\\Evaluator());\necho $server-\u003ereply('{\"jsonrpc\": \"2.0\", \"method\": \"math/subtract\", \"params\": {\"a\": 3, \"b\": 2}, \"id\": 1}');\n```\n\nOr to use a custom root namespace (here: `Datto\\NodeAPI`):\n\n```php\n$server = new Server(new Simple\\Evaluator(new Simple\\Mapper('Datto\\\\NodeAPI')));\necho $server-\u003ereply('...');\n```\n\nRequirements\n------------\n* PHP \u003e= 5.3\n\nInstallation\n------------\n```javascript\n\"require\": {\n  \"datto/json-rpc-simple\": \"~4.0\"\n}\n```\nLicense\n-------\nThis package is released under an open-source license: [LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.html).\n\nAuthor\n------\nWritten by [Philipp C. Heckel](https://github.com/binwiederhier).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatto%2Fphp-json-rpc-simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatto%2Fphp-json-rpc-simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatto%2Fphp-json-rpc-simple/lists"}