Skip to content

Commit ea39a64

Browse files
authored
Polish (#9)
1 parent 102cc0c commit ea39a64

File tree

7 files changed

+20
-35
lines changed

7 files changed

+20
-35
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ before_install:
2525
- phpenv config-rm xdebug.ini || true
2626

2727
install:
28-
- composer require symfony/http-foundation:$SYMFONY_VERSION symfony/http-kernel:$SYMFONY_VERSION symfony/config:$SYMFONY_VERSION symfony/dependency-injection:$SYMFONY_VERSION
28+
- composer require symfony/http-kernel:$SYMFONY_VERSION symfony/config:$SYMFONY_VERSION symfony/dependency-injection:$SYMFONY_VERSION
2929
- make build
3030
script:
3131
- make test-technical
@@ -35,3 +35,7 @@ cache:
3535
directories:
3636
- $HOME/.composer
3737
- vendor
38+
39+
branches:
40+
except:
41+
- /.*\-dev$/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# JSON-RPC server documentation
2-
[![License](https://img.shields.io/github/license/yoanm/symfony-jsonrpc-http-server-doc.svg)](https://github.com/yoanm/symfony-jsonrpc-http-server-doc) [![Code size](https://img.shields.io/github/languages/code-size/yoanm/symfony-jsonrpc-http-server-doc.svg)](https://github.com/yoanm/symfony-jsonrpc-http-server-doc)
2+
[![License](https://img.shields.io/github/license/yoanm/symfony-jsonrpc-http-server-doc.svg)](https://github.com/yoanm/symfony-jsonrpc-http-server-doc) [![Code size](https://img.shields.io/github/languages/code-size/yoanm/symfony-jsonrpc-http-server-doc.svg)](https://github.com/yoanm/symfony-jsonrpc-http-server-doc) [![Dependencies](https://img.shields.io/librariesio/github/yoanm/symfony-jsonrpc-http-server-doc.svg)](https://libraries.io/packagist/yoanm%2Fsymfony-jsonrpc-http-server-doc)
33

44
[![Scrutinizer Build Status](https://img.shields.io/scrutinizer/build/g/yoanm/symfony-jsonrpc-http-server-doc.svg?label=Scrutinizer&logo=scrutinizer)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server-doc/build-status/master) [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/yoanm/symfony-jsonrpc-http-server-doc/master.svg?logo=scrutinizer)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server-doc/?branch=master) [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/yoanm/symfony-jsonrpc-http-server-doc/master.svg?logo=scrutinizer)](https://scrutinizer-ci.com/g/yoanm/symfony-jsonrpc-http-server-doc/?branch=master)
55

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@
2626
"DemoApp\\": "features/demo_app/src"
2727
}
2828
},
29+
"suggest": {
30+
"yoanm/symfony-jsonrpc-http-server": "Symfony Bundle to convert an HTTP json-rpc request into HTTP json-rpc response",
31+
"yoanm/symfony-jsonrpc-params-sf-constraints-doc": "Symfony bundle for easy Symfony constraints to JSON-RPC documentation transformation",
32+
"yoanm/symfony-jsonrpc-http-server-openapi-doc": "Symfony bundle for easy JSON-RPC server OpenAPI 3.0.0 documentation",
33+
"yoanm/symfony-jsonrpc-http-server-swagger-doc": "Symfony bundle for easy JSON-RPC server Swagger 2.0 documentation"
34+
},
2935
"require": {
3036
"php": ">=7.1",
3137
"yoanm/jsonrpc-server-sdk": "dev-release/3.0.0",
32-
"yoanm/jsonrpc-server-doc-sdk": "dev-release/1.0.0",
38+
"yoanm/jsonrpc-server-doc-sdk": "dev-release/0.1.0",
3339
"yoanm/symfony-jsonrpc-http-server": "dev-release/2.0.0",
3440
"symfony/http-kernel": "^3.0 || ^4.0",
3541
"symfony/config": "^3.0 || ^4.0",

features/bootstrap/DemoAppContext.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use PHPUnit\Framework\Assert;
1010
use Symfony\Component\HttpFoundation\Request;
1111
use Symfony\Component\HttpFoundation\Response;
12-
use Yoanm\JsonRpcServer\Domain\JsonRpcMethodInterface;
1312

1413
/**
1514
* Defines application features from the specific context.
@@ -70,36 +69,6 @@ public function thenIShouldHaveAResponseFromDemoAppWithFollowingContent($httpCod
7069
Assert::assertSame((int) $httpCode, $this->lastResponse->getStatusCode());
7170
}
7271

73-
/**
74-
* @Then Collector should have :methodClass JSON-RPC method with name :methodName
75-
*/
76-
public function thenCollectorShouldHaveAMethodWithName($methodClass, $methodName)
77-
{
78-
$kernel = $this->getDemoAppKernel();
79-
$kernel->boot();
80-
$mappingList = $kernel->getContainer()
81-
->get('mapping_aware_service')
82-
->getMappingList()
83-
;
84-
$kernel->shutdown();
85-
86-
if (!isset($mappingList[$methodName])) {
87-
throw new \Exception(sprintf('No mapping defined to method name "%s"', $methodName));
88-
}
89-
$method = $mappingList[$methodName];
90-
91-
Assert::assertInstanceOf(
92-
JsonRpcMethodInterface::class,
93-
$method,
94-
'Method must be a JsonRpcMethodInterface instance'
95-
);
96-
Assert::assertInstanceOf(
97-
$methodClass,
98-
$method,
99-
sprintf('Method "%s" is not an instance of "%s"', $methodName, $methodClass)
100-
);
101-
}
102-
10372
/**
10473
* @return AbstractKernel
10574
*/

src/DependencyInjection/JsonRpcHttpServerDocExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function load(array $configs, ContainerBuilder $container)
3030

3131
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
3232

33-
$loader->load('services.sdk.yaml');
33+
$loader->load('services.sdk.infra.yaml');
3434
$loader->load('services.private.yaml');
3535
$loader->load('services.public.yaml');
3636
}

tests/Functional/DependencyInjection/ConfigFilesTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Yoanm\SymfonyJsonRpcHttpServerDoc\Creator\HttpServerDocCreator;
1313
use Yoanm\SymfonyJsonRpcHttpServerDoc\Endpoint\DocumentationEndpoint;
1414
use Yoanm\SymfonyJsonRpcHttpServerDoc\Finder\NormalizedDocFinder;
15+
use Yoanm\SymfonyJsonRpcHttpServerDoc\Listener\ServerDocCreatedListener;
1516
use Yoanm\SymfonyJsonRpcHttpServerDoc\Provider\RawDocProvider;
1617

1718
/**
@@ -127,6 +128,11 @@ public function provideBundlePrivateServiceIdAndClass()
127128
'serviceClassName' => NormalizedDocFinder::class,
128129
'public' => false,
129130
],
131+
'Bundle - Private - ServerDocCreatedListener' => [
132+
'serviceId' => 'json_rpc_http_server_doc.listener.server_doc_created',
133+
'serviceClassName' => ServerDocCreatedListener::class,
134+
'public' => false,
135+
],
130136
];
131137
}
132138
}

0 commit comments

Comments
 (0)