Skip to content

Commit 607073c

Browse files
committed
Merge branch 'release/1.0.0'
2 parents f7997ce + ca24a99 commit 607073c

File tree

7 files changed

+33
-17
lines changed

7 files changed

+33
-17
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ build
33
#A library must not provide a composer.lock file
44
composer.lock
55

6-
features/demo_app/var/
6+
features/demo_app/var/
7+
8+
#Phpunit
9+
.phpunit.result.cache

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ build:
4646
COVERAGE_OUTPUT_STYLE: 'clover'
4747
COVERAGE_CLOVER_FILE_PATH: 'build/coverage/clover.xml'
4848
php:
49-
version: "7.1"
49+
version: "7.3"
5050
timezone: UTC
5151
postgresql: false
5252
redis: false

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22

33
php:
4-
- '7.1'
54
- '7.2'
65
- '7.3'
76
- '7.4'
@@ -13,8 +12,8 @@ env:
1312
- PHPCS_REPORT_STYLE: 'full'
1413
- COMPOSER_OPTIONS: '--optimize-autoloader'
1514
jobs:
16-
- SYMFONY_VERSION: '~3.0'
1715
- SYMFONY_VERSION: '~4.0'
16+
- SYMFONY_VERSION: '~5.0'
1817

1918
jobs:
2019
fast_finish: true
@@ -24,7 +23,7 @@ before_install:
2423
- phpenv config-rm xdebug.ini || true
2524

2625
install:
27-
- composer require symfony/http-kernel:$SYMFONY_VERSION symfony/dependency-injection:$SYMFONY_VERSION symfony/routing:$SYMFONY_VERSION
26+
- composer require symfony/http-kernel:$SYMFONY_VERSION symfony/dependency-injection:$SYMFONY_VERSION symfony/config:$SYMFONY_VERSION symfony/routing:$SYMFONY_VERSION symfony/event-dispatcher:$SYMFONY_VERSION
2827
- make build
2928
script:
3029
- make test-technical

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44

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

7-
[![Travis Build Status](https://img.shields.io/travis/com/yoanm/symfony-jsonrpc-http-server-openapi-doc/master.svg?label=Travis&logo=travis)](https://travis-ci.com/yoanm/symfony-jsonrpc-http-server-openapi-doc) <!-- NOT WORKING WITH travis-ci.com [![Travis PHP versions](https://img.shields.io/travis/php-v/yoanm/symfony-jsonrpc-http-server-openapi-doc.svg?logo=travis)](https://php.net/) --> [![Travis Symfony Versions](https://img.shields.io/badge/Symfony-v3%20%2F%20v4-8892BF.svg?logo=travis)](https://symfony.com/)
7+
[![Travis Build Status](https://img.shields.io/travis/com/yoanm/symfony-jsonrpc-http-server-openapi-doc/master.svg?label=Travis&logo=travis)](https://travis-ci.com/yoanm/symfony-jsonrpc-http-server-openapi-doc) <!-- NOT WORKING WITH travis-ci.com [![Travis PHP versions](https://img.shields.io/travis/php-v/yoanm/symfony-jsonrpc-http-server-openapi-doc.svg?logo=travis)](https://php.net/) --> [![Travis Symfony Versions](https://img.shields.io/badge/Symfony-v4%20%2F%20v5-8892BF.svg?logo=travis)](https://symfony.com/)
88

99
[![Latest Stable Version](https://img.shields.io/packagist/v/yoanm/symfony-jsonrpc-http-server-openapi-doc.svg)](https://packagist.org/packages/yoanm/symfony-jsonrpc-http-server-openapi-doc) [![Packagist PHP version](https://img.shields.io/packagist/php-v/yoanm/symfony-jsonrpc-http-server-openapi-doc.svg)](https://packagist.org/packages/yoanm/symfony-jsonrpc-http-server-openapi-doc)
1010

1111
Symfony bundle for easy JSON-RPC server OpenAPI 3.0.0 documentation
1212

1313
Symfony bundle for [yoanm/jsonrpc-http-server-openapi-doc-sdk](https://github.com/yoanm/php-jsonrpc-http-server-openapi-doc-sdk)
1414

15+
## Versions
16+
- Symfony v3/4 - PHP >=7.1 : `^v0.X`
17+
- Symfony v4/5 - PHP >=7.2 : `^v1.0`
18+
1519
## How to use
1620

1721
Once configured, your project is ready to handle HTTP `GET` request on `/doc/openapi.json` endpoint. Result will be a openapi compatible file.

composer.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,24 @@
3232
"yoanm/symfony-jsonrpc-http-server": "Symfony Bundle to convert an HTTP json-rpc request into HTTP json-rpc response"
3333
},
3434
"require": {
35-
"php": ">=7.1",
36-
"symfony/config": "^3.0 || ^4.0",
37-
"symfony/dependency-injection": "^3.0 || ^4.0",
38-
"symfony/event-dispatcher-contracts": "^1.0",
39-
"symfony/http-kernel": "^3.0 || ^4.0",
35+
"php": ">=7.2",
36+
"symfony/config": "^4.0 || ^5.0",
37+
"symfony/dependency-injection": "^4.0 || ^5.0",
38+
"symfony/event-dispatcher-contracts": "^1.0 || ^2.0",
39+
"symfony/http-kernel": "^4.0 || ^5.0",
4040
"yoanm/jsonrpc-http-server-openapi-doc-sdk": "^0.2",
4141
"yoanm/jsonrpc-server-doc-sdk": "^0.2",
42-
"yoanm/symfony-jsonrpc-http-server-doc": "^0.2"
42+
"yoanm/symfony-jsonrpc-http-server-doc": "^1.0"
4343
},
4444
"require-dev": {
4545
"behat/behat": "~3.0",
4646
"matthiasnoback/symfony-config-test": "^3.0 || ^4.0",
4747
"matthiasnoback/symfony-dependency-injection-test": "^3.0 || ^4.0",
4848
"phpunit/phpunit": "^7.0 || ^8.0",
4949
"squizlabs/php_codesniffer": "3.*",
50-
"symfony/framework-bundle": "^3.0 || ^4.0",
51-
"symfony/routing": "^3.0 || ^4.0",
50+
"symfony/event-dispatcher": "^4.0 || ^5.0",
51+
"symfony/framework-bundle": "^4.0 || ^5.0",
52+
"symfony/routing": "^4.0 || ^5.0",
5253
"yoanm/php-unit-extended": "~1.0"
5354
}
5455
}

src/Provider/DocProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getDoc($host = null) : array
4848
$openApiDoc = $this->docNormalizer->normalize($rawDoc);
4949

5050
$event = new OpenAPIDocCreatedEvent($openApiDoc, $rawDoc);
51-
$this->dispatcher->dispatch($event::EVENT_NAME, $event);
51+
$this->dispatcher->dispatch($event, $event::EVENT_NAME);
5252

5353
return $event->getOpenAPIDoc();
5454
}

tests/Functional/Provider/DocProviderTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Yoanm\SymfonyJsonRpcHttpServerDoc\Creator\HttpServerDocCreator;
1111
use Yoanm\SymfonyJsonRpcHttpServerOpenAPIDoc\Event\OpenAPIDocCreatedEvent;
1212
use Yoanm\SymfonyJsonRpcHttpServerOpenAPIDoc\Provider\DocProvider;
13+
use Yoanm\SymfonyJsonRpcHttpServerSwaggerDoc\Event\SwaggerDocCreatedEvent;
1314

1415
/**
1516
* @covers \Yoanm\SymfonyJsonRpcHttpServerOpenAPIDoc\Provider\DocProvider
@@ -57,6 +58,14 @@ public function testShouldCreateHttpServerDocAndNormalizeIt()
5758
->shouldBeCalled()
5859
;
5960

61+
$this->dispatcher
62+
->dispatch(
63+
Argument::type(OpenApiDocCreatedEvent::class),
64+
OpenApiDocCreatedEvent::EVENT_NAME
65+
)
66+
->shouldBeCalled()
67+
;
68+
6069
$this->assertSame(
6170
$normalizedDoc,
6271
$this->provider->getDoc($host)
@@ -83,12 +92,12 @@ public function testShouldDispatchAnEvent()
8392

8493
$this->dispatcher
8594
->dispatch(
86-
OpenAPIDocCreatedEvent::EVENT_NAME,
8795
Argument::allOf(
8896
Argument::type(OpenAPIDocCreatedEvent::class),
8997
Argument::which('getOpenAPIDoc', $normalizedDoc),
9098
Argument::which('getServerDoc', $rawDoc->reveal())
91-
)
99+
),
100+
OpenAPIDocCreatedEvent::EVENT_NAME
92101
)
93102
->shouldBeCalled()
94103
;

0 commit comments

Comments
 (0)