Skip to content

Commit 9acfb34

Browse files
authored
Add methods mapping injections (#3)
1 parent de46b45 commit 9acfb34

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
"Tests\\Functional\\BehatContext\\": "features/bootstrap"
2626
}
2727
},
28+
"suggest": {
29+
"yoanm/symfony-jsonrpc-server-psr11-resolver": ""
30+
},
2831
"require": {
2932
"php": ">=7.1",
3033
"yoanm/jsonrpc-server-sdk": "dev-release/3.0.0",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
services:
22
json_rpc_http_server_doc.finder.normalized_doc:
33
class: Yoanm\SymfonyJsonRpcHttpServerDoc\Finder\NormalizedDocFinder
4+
5+
json_rpc_http_server_doc.listener.server_doc_created:
6+
class: Yoanm\SymfonyJsonRpcHttpServerDoc\Listener\ServerDocCreatedListener
7+
tags:
8+
-
9+
name: 'kernel.event_listener'
10+
event: 'json_rpc_http_server_doc.server_doc_created'
11+
method: 'appendJsonRpcServerErrorsDoc'
12+

src/Resources/config/services.public.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ services:
1212
arguments:
1313
- '@event_dispatcher'
1414
- '%json_rpc_http_server_doc.http_endpoint_path%'
15-
tags: ['json_rpc_http_server.method_aware']
15+
tags:
16+
- 'json_rpc_http_server.method_aware' # From yoanm/symfony-jsonrpc-http-server
1617

1718
json_rpc_http_server_doc.provider:
1819
class: Yoanm\SymfonyJsonRpcHttpServerDoc\Provider\RawDocProvider

tests/Functional/DependencyInjection/ConfigFilesTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
use Yoanm\JsonRpcServerDoc\Infra\Normalizer\ServerDocNormalizer;
99
use Yoanm\JsonRpcServerDoc\Infra\Normalizer\TagDocNormalizer;
1010
use Yoanm\JsonRpcServerDoc\Infra\Normalizer\TypeDocNormalizer;
11+
use Yoanm\SymfonyJsonRpcHttpServer\DependencyInjection\JsonRpcHttpServerExtension;
1112
use Yoanm\SymfonyJsonRpcHttpServerDoc\Creator\HttpServerDocCreator;
1213
use Yoanm\SymfonyJsonRpcHttpServerDoc\DependencyInjection\JsonRpcHttpServerDocExtension;
1314
use Yoanm\SymfonyJsonRpcHttpServerDoc\Endpoint\DocumentationEndpoint;
1415
use Yoanm\SymfonyJsonRpcHttpServerDoc\Finder\NormalizedDocFinder;
15-
use Yoanm\SymfonyJsonRpcHttpServerDoc\Provider\ChainNormalizedDocProvider;
1616
use Yoanm\SymfonyJsonRpcHttpServerDoc\Provider\RawDocProvider;
1717

1818
/**
@@ -51,6 +51,19 @@ public function testShouldHaveService($serviceId, $expectedClassName, $public)
5151
}
5252
}
5353

54+
public function testHttpServerDocCreatorShouldHaveMethodsMappingAwareTag()
55+
{
56+
$serviceId = 'json_rpc_http_server_doc.creator.http_server';
57+
58+
$this->load();
59+
60+
// From yoanm/symfony-jsonrpc-http-server
61+
$this->assertContainerBuilderHasServiceDefinitionWithTag(
62+
$serviceId,
63+
JsonRpcHttpServerExtension::JSONRPC_METHOD_AWARE_TAG
64+
);
65+
}
66+
5467
/**
5568
* @return array
5669
*/

0 commit comments

Comments
 (0)