Skip to content

Commit 2d99ffd

Browse files
committed
Merge branch 'release/2.1.0'
2 parents 3ac28ed + ffe37b1 commit 2d99ffd

13 files changed

+38
-43
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @yoanm

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ composer.lock
55

66
# Demo app excluded dirs
77
features/demo_app/var/
8+
9+
#Phpunit
10+
.phpunit.result.cache

.scrutinizer.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ build:
3636
COVERAGE_OUTPUT_STYLE: 'clover'
3737
COVERAGE_CLOVER_FILE_PATH: 'build/coverage/clover.xml'
3838
php:
39-
version: "7.1"
39+
version: "7.3"
4040
timezone: UTC
4141
postgresql: false
4242
redis: false

.travis.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
language: php
22

33
php:
4-
- '7.1'
54
- '7.2'
65
- '7.3'
76
- '7.4'
87

98
env:
109
global:
11-
CI: 'true'
12-
TEST_OUTPUT_STYLE: 'pretty'
13-
PHPCS_REPORT_STYLE: 'full'
14-
COMPOSER_OPTIONS: '--optimize-autoloader'
15-
matrix:
16-
- SYMFONY_VERSION: '~3.0'
17-
- SYMFONY_VERSION: '~4.0'
10+
- CI: 'true'
11+
- TEST_OUTPUT_STYLE: 'pretty'
12+
- PHPCS_REPORT_STYLE: 'full'
13+
- COMPOSER_OPTIONS: '--optimize-autoloader'
14+
jobs:
15+
- SYMFONY_VERSION: '~4.0'
16+
- SYMFONY_VERSION: '~5.0'
1817

1918
sudo: false
2019

@@ -40,4 +39,5 @@ cache:
4039
branches:
4140
except:
4241
- /.*\-dev$/
42+
- /^dev-.*$/
4343
- /.*\-patch(\-\d+)?$/

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

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

6-
[![Travis Build Status](https://img.shields.io/travis/yoanm/symfony-jsonrpc-http-server/master.svg?label=Travis&logo=travis)](https://travis-ci.org/yoanm/symfony-jsonrpc-http-server) [![Travis PHP versions](https://img.shields.io/travis/php-v/yoanm/symfony-jsonrpc-http-server.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/php-jsonrpc-params-symfony-validator-sdk/master.svg?label=Travis&logo=travis)](https://travis-ci.com/yoanm/php-jsonrpc-params-symfony-validator-sdk) <!-- NOT WORKING WITH travis-ci.com [![Travis PHP versions](https://img.shields.io/travis/php-v/yoanm/php-jsonrpc-params-symfony-validator-sdk.svg?logo=travis)](https://php.net/) --> [![Travis Symfony Versions](https://img.shields.io/badge/Symfony-v4%20%2F%20v5-8892BF.svg?logo=travis)](https://php.net/)
77

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

composer.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@
3131
"yoanm/symfony-jsonrpc-http-server-doc": "JSON-RPC documentation Bundle"
3232
},
3333
"require": {
34-
"php": ">=7.1",
34+
"php": ">=7.2",
3535
"yoanm/jsonrpc-server-sdk": "^3.0",
36-
"symfony/http-foundation": "^3.0 || ^4.0",
37-
"symfony/http-kernel": "^3.0 || ^4.0",
38-
"symfony/config": "^3.0 || ^4.0",
39-
"symfony/dependency-injection": "^3.0 || ^4.0"
36+
"symfony/http-foundation": "^4.0 || ^5.0",
37+
"symfony/http-kernel": "^4.0 || ^5.0",
38+
"symfony/config": "^4.0 || ^5.0",
39+
"symfony/dependency-injection": "^4.0 || ^5.0"
4040
},
4141
"require-dev": {
4242
"behat/behat": "~3.0",
4343
"squizlabs/php_codesniffer": "3.*",
4444
"phpunit/phpunit": "^7.0 || ^8.0",
4545
"matthiasnoback/symfony-dependency-injection-test": "^3.0 || ^4.0",
4646
"matthiasnoback/symfony-config-test": "^3.0 || ^4.0",
47-
"symfony/framework-bundle": "^3.0 || ^4.0",
48-
"symfony/http-kernel": "^3.0 || ^4.0",
49-
"symfony/routing": "^3.0 || ^4.0",
47+
"symfony/framework-bundle": "^4.0 || ^5.0",
48+
"symfony/http-kernel": "^4.0 || ^5.0",
49+
"symfony/routing": "^4.0 || ^5.0",
5050
"yoanm/php-unit-extended": "~1.0"
5151
}
5252
}

src/DependencyInjection/Configuration.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class Configuration implements ConfigurationInterface
1010

1111
public function getConfigTreeBuilder()
1212
{
13-
$treeBuilder = new TreeBuilder();
13+
$treeBuilder = new TreeBuilder(JsonRpcHttpServerExtension::EXTENSION_IDENTIFIER);
1414

15-
$rootNode = $treeBuilder->root(JsonRpcHttpServerExtension::EXTENSION_IDENTIFIER);
15+
$rootNode = $treeBuilder->getRootNode();
1616

1717
$rootNode
1818
->addDefaultsIfNotSet()

src/Dispatcher/SymfonyJsonRpcServerDispatcher.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ public function __construct(EventDispatcherInterface $symfonyEventDispatcher)
2323
}
2424

2525
/**
26-
* @param string $eventName
27-
* @param JsonRpcServerEvent|null $event
26+
* @param string|null $eventName
27+
* @param JsonRpcServerEvent $event
2828
*/
2929
public function dispatchJsonRpcEvent(string $eventName, JsonRpcServerEvent $event = null) : void
3030
{
3131
$this->symfonyEventDispatcher->dispatch(
32-
$eventName,
33-
$event ? new SymfonyJsonRpcServerEvent($event) : null
32+
$event ? new SymfonyJsonRpcServerEvent($event) : new \stdClass(),
33+
$eventName
3434
);
3535
}
3636

src/Endpoint/JsonRpcHttpEndpoint.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ public function httpOptions() : Response
3434
$response->headers->set('Content-Type', 'application/json');
3535

3636
// Set allowed http methods
37-
$response->headers->set('Allow', $this->allowedMethodList);
38-
$response->headers->set('Access-Control-Request-Method', $this->allowedMethodList);
37+
$allowedMethodListString = implode(', ', $this->allowedMethodList);
38+
$response->headers->set('Allow', $allowedMethodListString);
39+
$response->headers->set('Access-Control-Request-Method', $allowedMethodListString);
3940

4041
// Set allowed content type
4142
$response->headers->set('Accept', 'application/json');

src/Event/SymfonyJsonRpcServerEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace Yoanm\SymfonyJsonRpcHttpServer\Event;
33

4-
use Symfony\Component\EventDispatcher\Event;
4+
use Symfony\Contracts\EventDispatcher\Event;
55
use Yoanm\JsonRpcServer\Domain\Event\JsonRpcServerEvent;
66

77
/**

tests/Functional/DependencyInjection/JsonRpcMethodDefinitionHelperTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class JsonRpcMethodDefinitionHelperTest extends AbstractTestClass
1414
/** @var JsonRpcMethodDefinitionHelper */
1515
private $helper;
1616

17-
public function setUp(): void
17+
protected function setUp(): void
1818
{
1919
$this->helper = new JsonRpcMethodDefinitionHelper();
2020
parent::setUp();

tests/Functional/Dispatcher/SymfonyJsonRpcServerDispatcherTest.php

+2-12
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,14 @@ public function testShouldDispatchEventsWrappedIntoSpecificClass()
5555

5656
$this->sfDispatcher
5757
->dispatch(
58-
$eventName,
5958
Argument::allOf(
6059
Argument::type(SymfonyJsonRpcServerEvent::class),
6160
Argument::which('getJsonRpcServerEvent', $event->reveal())
62-
)
61+
),
62+
$eventName
6363
)
6464
->shouldBeCalled();
6565

6666
$this->dispatcher->dispatchJsonRpcEvent($eventName, $event->reveal());
6767
}
68-
69-
public function testShouldDispatchEventsWithOnlyName()
70-
{
71-
$eventName = 'event-name';
72-
73-
$this->sfDispatcher->dispatch($eventName, null)
74-
->shouldBeCalled();
75-
76-
$this->dispatcher->dispatchJsonRpcEvent($eventName);
77-
}
7868
}

tests/Functional/Endpoint/JsonRpcHttpEndpointTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ public function testHttPostShouldHandleRequestContentAndReturnA200ResponseContai
5353

5454
public function testHttOptionsShouldReturnAllowedMethodsAndContentType()
5555
{
56-
$expectedAllowedMethodList = [Request::METHOD_POST, Request::METHOD_OPTIONS];
56+
$expectedAllowedMethodList = implode(', ', [Request::METHOD_POST, Request::METHOD_OPTIONS]);
5757

5858
$response = $this->endpoint->httpOptions();
5959

6060
$this->assertSame(Response::HTTP_OK, $response->getStatusCode());
6161
$this->assertSame('application/json', $response->headers->get('Content-Type'));
6262

6363
// Check allowed methods
64-
$this->assertSame($expectedAllowedMethodList, $response->headers->get('Allow', null, false));
64+
$this->assertSame($expectedAllowedMethodList, $response->headers->get('Allow', null));
6565
$this->assertSame(
6666
$expectedAllowedMethodList,
67-
$response->headers->get('Access-Control-Request-Method', null, false)
67+
$response->headers->get('Access-Control-Request-Method', null)
6868
);
6969

7070
// Check allowed content types

0 commit comments

Comments
 (0)