neznajki / json-rpc-server
server for json rpc
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
pkg:composer/neznajki/json-rpc-server
Requires
- php: >=7.3
- ext-json: *
- neznajki/json-rpc-common: ^1.0
Requires (Dev)
- symfony/dependency-injection: ^4.4
- symfony/event-dispatcher: ^4.4
- symfony/flex: ^1.4
- symfony/framework-bundle: ^4.4
README
makes authorization for json rpc
installation
- composer require neznajki/json-rpc-server
- services.yaml
imports: - { resource: '@JsonRpcServerBundle/Resources/config/services.yaml' }
- routes.yaml
jsonRpc: resource: '@JsonRpcServerBundle/Resources/config/routing.yaml'
method creation
App\Api\CoolMethod: tags: [ 'json.rpc.server.method' ]
class CoolMethod implements MethodHandlerInterface { /** * @param string $test * @param int|null $test2 * @return mixed */ public function handle(string $test = null, ?int $test2 = null) { return $test . 'tt'; } /** * @return string */ public function getMethod(): string { return 'coolMethodIncomingName'; } /** * @return array */ public function getRequiredParameters(): array { return ['test']; } }