diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index da78f14..0f3152f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 @@ -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' }} @@ -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: @@ -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 }} \ diff --git a/README.md b/README.md index 7646402..6c61d13 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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. diff --git a/composer.json b/composer.json index f3dab11..cf17ee9 100644 --- a/composer.json +++ b/composer.json @@ -32,12 +32,12 @@ "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": { @@ -45,12 +45,13 @@ "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": { diff --git a/features/demo_app/src/AbstractKernel.php b/features/demo_app/src/AbstractKernel.php index 01af49c..62897dc 100644 --- a/features/demo_app/src/AbstractKernel.php +++ b/features/demo_app/src/AbstractKernel.php @@ -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) { @@ -44,7 +44,7 @@ public function getCacheDir() /** * {@inheritdoc} */ - public function getLogDir() + public function getLogDir(): string { return $this->getProjectDir().'/var/log'; } @@ -52,7 +52,7 @@ public function getLogDir() /** * {@inheritdoc} */ - public function getProjectDir() + public function getProjectDir(): string { return realpath(__DIR__.'/../'); } @@ -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()); diff --git a/src/DependencyInjection/JsonRpcHttpServerExtension.php b/src/DependencyInjection/JsonRpcHttpServerExtension.php index d71bfaf..9922002 100644 --- a/src/DependencyInjection/JsonRpcHttpServerExtension.php +++ b/src/DependencyInjection/JsonRpcHttpServerExtension.php @@ -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 )); diff --git a/tests/Common/DependencyInjection/AbstractTestClass.php b/tests/Common/DependencyInjection/AbstractTestClass.php index 7ae993f..c4f9693 100644 --- a/tests/Common/DependencyInjection/AbstractTestClass.php +++ b/tests/Common/DependencyInjection/AbstractTestClass.php @@ -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() diff --git a/tests/Functional/DependencyInjection/JsonRpcHttpServerExtensionTest.php b/tests/Functional/DependencyInjection/JsonRpcHttpServerExtensionTest.php index 0d04c79..2aac4c7 100644 --- a/tests/Functional/DependencyInjection/JsonRpcHttpServerExtensionTest.php +++ b/tests/Functional/DependencyInjection/JsonRpcHttpServerExtensionTest.php @@ -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 ));