Skip to content

Allow Symfony 6.x #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ jobs:
# Late php migration => Latest symfony version with lowest minor php version allowed by composer config
- symfony-version: '5.4'
php-version: '8.0'
# Symfony 6.0 latest
- symfony-version: '6.0'
php-version: '8.2'
# Symfony 6.0 lowest
- symfony-version: '6.0'
php-version: '8.0'
composer-flag: --prefer-lowest
steps:
- name: Check out code
uses: actions/checkout@v3
Expand Down Expand Up @@ -162,7 +169,7 @@ jobs:
run: make build

- name: ComposerRequireChecker
uses: docker://webfactory/composer-require-checker:3.2.0
uses: docker://webfactory/composer-require-checker:4.5.0

- name: Dependencies check
if: ${{ github.event_name == 'pull_request' }}
Expand Down Expand Up @@ -209,8 +216,9 @@ jobs:
symfony-version:
- '4.4' # Lowest LTS
- '5.4' # Latest LTS
- '6.0' # Current major version
include:
- symfony-version: '6.0' # Next symfony minor version to manage with latest supported PHP version
- symfony-version: '6.3' # Next symfony minor version to manage with latest supported PHP version
php-version: '8.2'

steps:
Expand Down Expand Up @@ -239,7 +247,8 @@ jobs:

- name: Build
run: |
composer require -W ${{ env.COMPOSER_OPTIONS }} \
composer config minimum-stability dev \
&& composer require -W ${{ env.COMPOSER_OPTIONS }} \
symfony/http-foundation:^${{ matrix.symfony-version }} \
symfony/http-kernel:^${{ matrix.symfony-version }} \
symfony/config:^${{ matrix.symfony-version }} \
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[![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)
[![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)
[![Symfony Versions](https://img.shields.io/badge/Symfony-v4%20%2F%20v5%20-8892BF.svg?logo=github)](https://symfony.com/)
[![Symfony Versions](https://img.shields.io/badge/Symfony-v4.4%20%2F%20v5.4%2F%20v6.x-8892BF.svg?logo=github)](https://symfony.com/)

[![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)
Expand All @@ -33,6 +33,10 @@ See [yoanm/symfony-jsonrpc-http-server-doc](https://github.com/yoanm/symfony-jso

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

* Symfony v4.4/5.4 - PHP ^8.0 : `^3.2`

* Symfony v4.4/5.4/6.x - PHP ^8.0 : `^3.3`

## How to use

Once configured, your project is ready to handle HTTP `POST` request on `/json-rpc` endpoint.
Expand Down
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,26 @@
"require": {
"php": "^8.0",
"psr/container": "^1.0",
"symfony/config": "^4.4 || ^5.4",
"symfony/dependency-injection": "^4.4 || ^5.4",
"symfony/event-dispatcher": "^4.4 || ^5.4",
"symfony/event-dispatcher-contracts": "^1.0 || ^2.0",
"symfony/http-foundation": "^4.4 || ^5.4",
"symfony/http-kernel": "^4.4 || ^5.4",
"symfony/config": "^4.4 || ^5.4 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0",
"symfony/event-dispatcher-contracts": "^1.0 || ^2.0 || ^3.0",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0",
"yoanm/jsonrpc-server-sdk": "^3.0"
},
"require-dev": {
"behat/behat": "^3.9.0",
"dvdoug/behat-code-coverage": "^5.0",
"matthiasnoback/symfony-config-test": "^4.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"phpspec/prophecy": "^1.15",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/php-code-coverage": "^9.2.4",
"phpunit/phpunit": "^9.0",
"squizlabs/php_codesniffer": "^3.5",
"symfony/framework-bundle": "^4.4 || ^5.4",
"symfony/routing": "^4.4 || ^5.4",
"symfony/framework-bundle": "^4.4 || ^5.4 || ^6.0",
"symfony/routing": "^4.4 || ^5.4 || ^6.0",
"yoanm/php-unit-extended": "^2.0"
},
"config": {
Expand Down
8 changes: 4 additions & 4 deletions features/demo_app/src/AbstractKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function registerBundles(): iterable
/**
* {@inheritdoc}
*/
public function getCacheDir()
public function getCacheDir(): string
{
// Use a specific cache for each kernels
if (null === $this->customCacheDir) {
Expand All @@ -44,15 +44,15 @@ public function getCacheDir()
/**
* {@inheritdoc}
*/
public function getLogDir()
public function getLogDir(): string
{
return $this->getProjectDir().'/var/log';
}

/**
* {@inheritdoc}
*/
public function getProjectDir()
public function getProjectDir(): string
{
return realpath(__DIR__.'/../');
}
Expand Down Expand Up @@ -86,7 +86,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
*
* @return string The container class
*/
protected function getContainerClass()
protected function getContainerClass(): string
{
// In order to avoid collisions between kernels use a dedicated name
return parent::getContainerClass().Container::camelize($this->getConfigDirectoryName());
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/JsonRpcHttpServerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private function checkMethodAwareServiceIdList(

if (null !== $class && !$class->implementsInterface(JsonRpcMethodAwareInterface::class)) {
throw new LogicException(sprintf(
'Service "%s" is taggued as JSON-RPC method aware but does not implement %s',
'Service "%s" is tagged as JSON-RPC method aware but does not implement %s',
$serviceId,
JsonRpcMethodAwareInterface::class
));
Expand Down
2 changes: 1 addition & 1 deletion tests/Common/DependencyInjection/AbstractTestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function addJsonRpcMethodTag(Definition $definition, $methodName)
protected function createJsonRpcMethodDefinition($class = ConcreteJsonRpcMethod::class)
{
return (new Definition($class))
->setPrivate(false);
->setPublic(true);
}

protected function mockResolver()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function testShouldThowAnExceptionIfMethodAwareServiceDoesNotImplementRig

$this->expectException(LogicException::class);
$this->expectExceptionMessage(sprintf(
'Service "%s" is taggued as JSON-RPC method aware but does not implement %s',
'Service "%s" is tagged as JSON-RPC method aware but does not implement %s',
$methodAwareServiceServiceId,
JsonRpcMethodAwareInterface::class
));
Expand Down