Skip to content

Commit 69521ee

Browse files
authored
V2 (#26)
1 parent 1c2a4d4 commit 69521ee

File tree

70 files changed

+793
-2101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+793
-2101
lines changed

.scrutinizer.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,19 @@ build_failure_conditions:
1010
- 'issues.label("coding-style").exists' # No coding style issues allowed
1111
build:
1212
dependencies:
13-
before:
14-
- composer global require hirak/prestissimo
1513
override:
1614
- make build
1715
tests:
1816
stop_on_failure: true
1917
override:
20-
- php-scrutinizer-run
21-
-
22-
command: make codestyle
23-
analysis:
24-
file: 'build/reports/cs-data'
25-
format: 'php-cs-checkstyle'
2618
-
2719
command: make coverage
2820
idle_timeout: 1200
2921
coverage:
3022
file: 'build/coverage/clover.xml'
3123
format: 'php-clover'
24+
- php-scrutinizer-run --enable-security-analysis
25+
- make codestyle
3226
cache:
3327
directories:
3428
- ~/.composer
@@ -38,11 +32,9 @@ build:
3832
variables:
3933
CI: 'true'
4034
TEST_OUTPUT_STYLE: 'pretty'
35+
COMPOSER_OPTIONS: '--optimize-autoloader'
4136
COVERAGE_OUTPUT_STYLE: 'clover'
4237
COVERAGE_CLOVER_FILE_PATH: 'build/coverage/clover.xml'
43-
PHPCS_REPORT_STYLE: 'checkstyle'
44-
PHPCS_REPORT_FILE: 'build/reports/cs-data'
45-
COMPOSER_OPTIONS: '--optimize-autoloader'
4638
php:
4739
version: "7.1"
4840
timezone: UTC

.travis.yml

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

33
php:
4-
- '7.0'
54
- '7.1'
65
- '7.2'
6+
- '7.3'
77

88
env:
99
global:
1010
CI: 'true'
1111
TEST_OUTPUT_STYLE: 'pretty'
1212
PHPCS_REPORT_STYLE: 'full'
1313
COMPOSER_OPTIONS: '--optimize-autoloader'
14-
matrix:
15-
- SDK_VERSION: '~1.2'
16-
- SDK_VERSION: '~2.0'
1714

1815
sudo: false
1916

@@ -22,10 +19,9 @@ matrix:
2219

2320
before_install:
2421
# remove xdebug to speed up build
25-
- phpenv config-rm xdebug.ini
22+
- phpenv config-rm xdebug.ini || true
2623

2724
install:
28-
- composer require yoanm/jsonrpc-server-sdk:$SDK_VERSION
2925
- make build
3026
script:
3127
- make test-technical

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ You have many ways to inject you json-rpc methods :
135135
```yaml
136136
# config/config.yaml
137137
json_rpc_http_server:
138-
http_endpoint_path: '/my-custom-endpoint'
138+
endpoint: '/my-custom-endpoint'
139139
```
140140
141141
- Or you can define your own route and bind the endpoint as below :

behat.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ default:
22
suites:
33
default:
44
contexts:
5-
- Tests\Functional\BehatContext\SymfonyExtensionContext: ~
65
- Tests\Functional\BehatContext\DemoAppContext: ~

composer.json

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
11
{
2-
"name": "yoanm/symfony-jsonrpc-http-server",
3-
"description": "Symfony Server SDK to convert an HTTP json-rpc request into HTTP json-rpc response",
4-
"license": "GPL-3.0-only",
5-
"type": "library",
6-
"support": {
7-
"issues": "https://github.com/yoanm/symfony-jsonrpc-http-server/issues"
8-
},
9-
"authors": [
10-
{
11-
"name": "Yoanm",
12-
"email": "yoanm@users.noreply.github.com",
13-
"role": "Developer"
14-
}
15-
],
16-
"autoload": {
17-
"psr-4": {
18-
"Yoanm\\SymfonyJsonRpcHttpServer\\": "src"
19-
}
20-
},
21-
"autoload-dev": {
22-
"psr-4": {
23-
"Tests\\": "tests",
24-
"Tests\\Functional\\BehatContext\\": "features/bootstrap",
25-
"DemoApp\\": "features/demo_app/src"
26-
}
27-
},
28-
"require": {
29-
"php": ">7.0",
30-
"yoanm/jsonrpc-server-sdk": "~1.2 || ~2.0",
31-
"symfony/http-foundation": "^3.0 || ^4.0",
32-
"symfony/dependency-injection": "^3.0 || ^4.0",
33-
"yoanm/jsonrpc-server-sdk-psr11-resolver": "^2.0"
34-
},
35-
"suggest": {
36-
"symfony/http-kernel": "To ease integration inside your application by using JsonRpcHttpServerBundle"
37-
},
38-
"require-dev": {
39-
"behat/behat": "~3.0",
40-
"squizlabs/php_codesniffer": "3.*",
41-
"phpunit/phpunit": "^6.0 || ^7.0",
42-
"matthiasnoback/symfony-dependency-injection-test": "^2.0 || ^3.0",
43-
"matthiasnoback/symfony-config-test": "^3.0 || ^4.0",
44-
"symfony/framework-bundle": "^3.4",
45-
"symfony/http-kernel": "^3.4",
46-
"symfony/routing": "^3.4",
47-
"yoanm/php-unit-extended": "~1.0"
2+
"name": "yoanm/symfony-jsonrpc-http-server",
3+
"description": "Symfony Server SDK to convert an HTTP json-rpc request into HTTP json-rpc response",
4+
"license": "MIT",
5+
"minimum-stability": "dev",
6+
"type": "library",
7+
"support": {
8+
"issues": "https://github.com/yoanm/symfony-jsonrpc-http-server/issues"
9+
},
10+
"authors": [
11+
{
12+
"name": "Yoanm",
13+
"email": "yoanm@users.noreply.github.com",
14+
"role": "Developer"
4815
}
16+
],
17+
"autoload": {
18+
"psr-4": {
19+
"Yoanm\\SymfonyJsonRpcHttpServer\\": "src"
20+
}
21+
},
22+
"autoload-dev": {
23+
"psr-4": {
24+
"Tests\\": "tests",
25+
"Tests\\Functional\\BehatContext\\": "features/bootstrap",
26+
"DemoApp\\": "features/demo_app/src"
27+
}
28+
},
29+
"require": {
30+
"php": ">=7.1",
31+
"yoanm/jsonrpc-server-sdk": "dev-release/3.0.0",
32+
"symfony/http-foundation": "^3.0 || ^4.0",
33+
"symfony/http-kernel": "^3.0 || ^4.0",
34+
"symfony/config": "^3.0 || ^4.0",
35+
"symfony/dependency-injection": "^3.0 || ^4.0"
36+
},
37+
"require-dev": {
38+
"behat/behat": "~3.0",
39+
"squizlabs/php_codesniffer": "3.*",
40+
"phpunit/phpunit": "^6.0 || ^7.0",
41+
"matthiasnoback/symfony-dependency-injection-test": "^2.0 || ^3.0",
42+
"matthiasnoback/symfony-config-test": "^3.0 || ^4.0",
43+
"symfony/framework-bundle": "^3.4",
44+
"symfony/http-kernel": "^3.4",
45+
"symfony/routing": "^3.4",
46+
"yoanm/php-unit-extended": "~1.0"
47+
}
4948
}

features/bootstrap/DemoAppContext.php

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
use Behat\Gherkin\Node\PyStringNode;
66
use DemoApp\AbstractKernel;
77
use DemoApp\DefaultKernel;
8-
use DemoApp\KernelWithBundle;
9-
use DemoApp\KernelWithBundleAndCustomResolver;
10-
use DemoApp\KernelWithBundleAndMethodsMapping;
11-
use DemoApp\KernelWithCustomResolver;
128
use PHPUnit\Framework\Assert;
139
use Symfony\Component\HttpFoundation\Request;
1410
use Symfony\Component\HttpFoundation\Response;
@@ -20,37 +16,6 @@ class DemoAppContext implements Context
2016
{
2117
/** @var Response|null */
2218
private $lastResponse;
23-
/** @var bool */
24-
private $useCustomResolver = false;
25-
/** @var bool */
26-
private $useBundle = false;
27-
/** @var bool */
28-
private $useBundleMethodsMappingFromConfiguration = false;
29-
30-
/**
31-
* @Given I use my DemoApp custom method resolver
32-
*/
33-
public function givenIUseMyDemoAppCustomMethodResolve()
34-
{
35-
$this->useCustomResolver = true;
36-
}
37-
38-
/**
39-
* @Given DemoApp will use JsonRpcHttpServerBundle
40-
*/
41-
public function givenDemoAppWillUseBundle()
42-
{
43-
$this->useBundle = true;
44-
}
45-
46-
/**
47-
* @Given DemoApp will use JsonRpcHttpServerBundle with methods mapping configuration
48-
*/
49-
public function givenDemoAppWillUseBundleWithMethodsMappingConfiguration()
50-
{
51-
$this->givenDemoAppWillUseBundle();
52-
$this->useBundleMethodsMappingFromConfiguration = true;
53-
}
5419

5520
/**
5621
* @When I send following :httpMethod input on :uri demoApp kernel endpoint:
@@ -88,16 +53,6 @@ protected function getDemoAppKernel()
8853
{
8954
$env = 'prod';
9055
$debug = true;
91-
switch (true) {
92-
case true === $this->useBundleMethodsMappingFromConfiguration:
93-
return new KernelWithBundleAndMethodsMapping($env, $debug);
94-
case true === $this->useBundle && true === $this->useCustomResolver:
95-
return new KernelWithBundleAndCustomResolver($env, $debug);
96-
case true === $this->useBundle && false === $this->useCustomResolver:
97-
return new KernelWithBundle($env, $debug);
98-
case false === $this->useBundle && true === $this->useCustomResolver:
99-
return new KernelWithCustomResolver($env, $debug);
100-
}
10156

10257
return new DefaultKernel($env, $debug);
10358
}

0 commit comments

Comments
 (0)