Skip to content

Commit 929e65a

Browse files
yoanmlzpoleg-zinchenkoklimov-paul
authored
Allow Symfony 6.x (#91)
Co-authored-by: lzp <[email protected]> Co-authored-by: oleg-zinchenko <[email protected]> Co-authored-by: Paul Klimov <[email protected]>
1 parent dc9ff3a commit 929e65a

File tree

7 files changed

+33
-19
lines changed

7 files changed

+33
-19
lines changed

.github/workflows/CI.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ jobs:
4646
# Late php migration => Latest symfony version with lowest minor php version allowed by composer config
4747
- symfony-version: '5.4'
4848
php-version: '8.0'
49+
# Symfony 6.0 latest
50+
- symfony-version: '6.0'
51+
php-version: '8.2'
52+
# Symfony 6.0 lowest
53+
- symfony-version: '6.0'
54+
php-version: '8.0'
55+
composer-flag: --prefer-lowest
4956
steps:
5057
- name: Check out code
5158
uses: actions/checkout@v3
@@ -162,7 +169,7 @@ jobs:
162169
run: make build
163170

164171
- name: ComposerRequireChecker
165-
uses: docker://webfactory/composer-require-checker:3.2.0
172+
uses: docker://webfactory/composer-require-checker:4.5.0
166173

167174
- name: Dependencies check
168175
if: ${{ github.event_name == 'pull_request' }}
@@ -209,8 +216,9 @@ jobs:
209216
symfony-version:
210217
- '4.4' # Lowest LTS
211218
- '5.4' # Latest LTS
219+
- '6.0' # Current major version
212220
include:
213-
- symfony-version: '6.0' # Next symfony minor version to manage with latest supported PHP version
221+
- symfony-version: '6.3' # Next symfony minor version to manage with latest supported PHP version
214222
php-version: '8.2'
215223

216224
steps:
@@ -239,7 +247,8 @@ jobs:
239247

240248
- name: Build
241249
run: |
242-
composer require -W ${{ env.COMPOSER_OPTIONS }} \
250+
composer config minimum-stability dev \
251+
&& composer require -W ${{ env.COMPOSER_OPTIONS }} \
243252
symfony/http-foundation:^${{ matrix.symfony-version }} \
244253
symfony/http-kernel:^${{ matrix.symfony-version }} \
245254
symfony/config:^${{ matrix.symfony-version }} \

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[![CI](https://github.com/yoanm/symfony-jsonrpc-http-server/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/yoanm/symfony-jsonrpc-http-server/actions/workflows/CI.yml)
1212
[![codecov](https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server/branch/master/graph/badge.svg?token=NHdwEBUFK5)](https://codecov.io/gh/yoanm/symfony-jsonrpc-http-server)
13-
[![Symfony Versions](https://img.shields.io/badge/Symfony-v4%20%2F%20v5%20-8892BF.svg?logo=github)](https://symfony.com/)
13+
[![Symfony Versions](https://img.shields.io/badge/Symfony-v4.4%20%2F%20v5.4%2F%20v6.x-8892BF.svg?logo=github)](https://symfony.com/)
1414

1515
[![Latest Stable Version](https://img.shields.io/packagist/v/yoanm/symfony-jsonrpc-http-server.svg)](https://packagist.org/packages/yoanm/symfony-jsonrpc-http-server)
1616
[![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)
@@ -33,6 +33,10 @@ See [yoanm/symfony-jsonrpc-http-server-doc](https://github.com/yoanm/symfony-jso
3333

3434
* Symfony v4/5 - PHP >=7.3 : `^3.1`
3535

36+
* Symfony v4.4/5.4 - PHP ^8.0 : `^3.2`
37+
38+
* Symfony v4.4/5.4/6.x - PHP ^8.0 : `^3.3`
39+
3640
## How to use
3741

3842
Once configured, your project is ready to handle HTTP `POST` request on `/json-rpc` endpoint.

composer.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,26 @@
3232
"require": {
3333
"php": "^8.0",
3434
"psr/container": "^1.0",
35-
"symfony/config": "^4.4 || ^5.4",
36-
"symfony/dependency-injection": "^4.4 || ^5.4",
37-
"symfony/event-dispatcher": "^4.4 || ^5.4",
38-
"symfony/event-dispatcher-contracts": "^1.0 || ^2.0",
39-
"symfony/http-foundation": "^4.4 || ^5.4",
40-
"symfony/http-kernel": "^4.4 || ^5.4",
35+
"symfony/config": "^4.4 || ^5.4 || ^6.0",
36+
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0",
37+
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0",
38+
"symfony/event-dispatcher-contracts": "^1.0 || ^2.0 || ^3.0",
39+
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0",
40+
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0",
4141
"yoanm/jsonrpc-server-sdk": "^3.0"
4242
},
4343
"require-dev": {
4444
"behat/behat": "^3.9.0",
4545
"dvdoug/behat-code-coverage": "^5.0",
4646
"matthiasnoback/symfony-config-test": "^4.0",
4747
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
48+
"phpspec/prophecy": "^1.15",
4849
"phpspec/prophecy-phpunit": "^2.0",
4950
"phpunit/php-code-coverage": "^9.2.4",
5051
"phpunit/phpunit": "^9.0",
5152
"squizlabs/php_codesniffer": "^3.5",
52-
"symfony/framework-bundle": "^4.4 || ^5.4",
53-
"symfony/routing": "^4.4 || ^5.4",
53+
"symfony/framework-bundle": "^4.4 || ^5.4 || ^6.0",
54+
"symfony/routing": "^4.4 || ^5.4 || ^6.0",
5455
"yoanm/php-unit-extended": "^2.0"
5556
},
5657
"config": {

features/demo_app/src/AbstractKernel.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function registerBundles(): iterable
3131
/**
3232
* {@inheritdoc}
3333
*/
34-
public function getCacheDir()
34+
public function getCacheDir(): string
3535
{
3636
// Use a specific cache for each kernels
3737
if (null === $this->customCacheDir) {
@@ -44,15 +44,15 @@ public function getCacheDir()
4444
/**
4545
* {@inheritdoc}
4646
*/
47-
public function getLogDir()
47+
public function getLogDir(): string
4848
{
4949
return $this->getProjectDir().'/var/log';
5050
}
5151

5252
/**
5353
* {@inheritdoc}
5454
*/
55-
public function getProjectDir()
55+
public function getProjectDir(): string
5656
{
5757
return realpath(__DIR__.'/../');
5858
}
@@ -86,7 +86,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
8686
*
8787
* @return string The container class
8888
*/
89-
protected function getContainerClass()
89+
protected function getContainerClass(): string
9090
{
9191
// In order to avoid collisions between kernels use a dedicated name
9292
return parent::getContainerClass().Container::camelize($this->getConfigDirectoryName());

src/DependencyInjection/JsonRpcHttpServerExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ private function checkMethodAwareServiceIdList(
217217

218218
if (null !== $class && !$class->implementsInterface(JsonRpcMethodAwareInterface::class)) {
219219
throw new LogicException(sprintf(
220-
'Service "%s" is taggued as JSON-RPC method aware but does not implement %s',
220+
'Service "%s" is tagged as JSON-RPC method aware but does not implement %s',
221221
$serviceId,
222222
JsonRpcMethodAwareInterface::class
223223
));

tests/Common/DependencyInjection/AbstractTestClass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function addJsonRpcMethodTag(Definition $definition, $methodName)
8484
protected function createJsonRpcMethodDefinition($class = ConcreteJsonRpcMethod::class)
8585
{
8686
return (new Definition($class))
87-
->setPrivate(false);
87+
->setPublic(true);
8888
}
8989

9090
protected function mockResolver()

tests/Functional/DependencyInjection/JsonRpcHttpServerExtensionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function testShouldThowAnExceptionIfMethodAwareServiceDoesNotImplementRig
178178

179179
$this->expectException(LogicException::class);
180180
$this->expectExceptionMessage(sprintf(
181-
'Service "%s" is taggued as JSON-RPC method aware but does not implement %s',
181+
'Service "%s" is tagged as JSON-RPC method aware but does not implement %s',
182182
$methodAwareServiceServiceId,
183183
JsonRpcMethodAwareInterface::class
184184
));

0 commit comments

Comments
 (0)