Skip to content

Commit 672ca83

Browse files
committed
Merge branch 'release/1.0.0'
2 parents 0f61260 + b663b5c commit 672ca83

File tree

7 files changed

+31
-16
lines changed

7 files changed

+31
-16
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ build
44
composer.lock
55

66
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/config:$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
@@ -3,14 +3,18 @@
33

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

6-
[![Travis Build Status](https://img.shields.io/travis/com/yoanm/symfony-jsonrpc-http-server-swagger-doc/master.svg?label=Travis&logo=travis)](https://travis-ci.com/yoanm/symfony-jsonrpc-http-server-swagger-doc) <!-- NOT WORKING WITH travis-ci.com [![Travis PHP versions](https://img.shields.io/travis/php-v/yoanm/symfony-jsonrpc-http-server-swagger-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/)
6+
[![Travis Build Status](https://img.shields.io/travis/com/yoanm/symfony-jsonrpc-http-server-swagger-doc/master.svg?label=Travis&logo=travis)](https://travis-ci.com/yoanm/symfony-jsonrpc-http-server-swagger-doc) <!-- NOT WORKING WITH travis-ci.com [![Travis PHP versions](https://img.shields.io/travis/php-v/yoanm/symfony-jsonrpc-http-server-swagger-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/)
77

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

1010
Symfony bundle for easy JSON-RPC server Swagger 2.0 documentation
1111

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

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

1620
Once configured, your project is ready to handle HTTP `GET` request on `/doc/swagger.json` endpoint. Result will be a swagger 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-swagger-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
@@ -47,7 +47,7 @@ public function getDoc($host = null) : array
4747
$swaggerDoc = $this->docNormalizer->normalize($rawDoc);
4848

4949
$event = new SwaggerDocCreatedEvent($swaggerDoc, $rawDoc);
50-
$this->dispatcher->dispatch($event::EVENT_NAME, $event);
50+
$this->dispatcher->dispatch($event, $event::EVENT_NAME);
5151

5252
return $event->getSwaggerDoc();
5353
}

tests/Functional/Provider/DocProviderTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ public function testShouldCreateHttpServerDocAndNormalizeIt()
5757
->shouldBeCalled()
5858
;
5959

60+
$this->dispatcher
61+
->dispatch(
62+
Argument::type(SwaggerDocCreatedEvent::class),
63+
SwaggerDocCreatedEvent::EVENT_NAME
64+
)
65+
->shouldBeCalled()
66+
;
67+
6068
$this->assertSame(
6169
$normalizedDoc,
6270
$this->provider->getDoc($host)
@@ -83,12 +91,12 @@ public function testShouldDispatchAnEvent()
8391

8492
$this->dispatcher
8593
->dispatch(
86-
SwaggerDocCreatedEvent::EVENT_NAME,
8794
Argument::allOf(
8895
Argument::type(SwaggerDocCreatedEvent::class),
8996
Argument::which('getSwaggerDoc', $normalizedDoc),
9097
Argument::which('getServerDoc', $rawDoc->reveal())
91-
)
98+
),
99+
SwaggerDocCreatedEvent::EVENT_NAME
92100
)
93101
->shouldBeCalled()
94102
;

0 commit comments

Comments
 (0)