From 85dc6cf3676a17022a64ed7e8db56f01686d3f51 Mon Sep 17 00:00:00 2001 From: Grigory Tihonov Date: Tue, 16 May 2023 16:01:44 +0400 Subject: [PATCH] Add symfony 5 support --- composer.json | 12 ++++++------ src/DependencyInjection/Configuration.php | 4 ++-- tests/App/Kernel.php | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 3dd4b31..7544a94 100644 --- a/composer.json +++ b/composer.json @@ -13,16 +13,16 @@ "require": { "php": "^7.2", "lamoda/atol-client": "^1.3.0", - "symfony/dependency-injection": "^3.4 || ^4.0", - "symfony/http-kernel": "^3.4 || ^4.0", - "symfony/config": "^3.4 || ^4.0", - "symfony/yaml": "^3.4 || ^4.0", + "symfony/dependency-injection": "^4.0 || ^5.0", + "symfony/http-kernel": "^4.0 || ^5.0", + "symfony/config": "^4.0 || ^5.0", + "symfony/yaml": "^4.0 || ^5.0", "jms/serializer-bundle": "^3.3", "guzzlehttp/guzzle": "^6.0" }, "require-dev": { - "symfony/symfony": "~2.8 || ~3.4 || ^4.2.9", - "phpunit/phpunit": "^5.7.10", + "symfony/symfony": "^4.2.9 || 5.4", + "phpunit/phpunit": "^7.5.20", "friendsofphp/php-cs-fixer": "^2.11" }, "autoload": { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 0133933..d93d5a3 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -10,9 +10,9 @@ final class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder() { - $builder = new TreeBuilder(); + $builder = new TreeBuilder('atol_client'); - $root = $builder->root('atol_client'); + $root = $builder->getRootNode(); $root ->beforeNormalization() diff --git a/tests/App/Kernel.php b/tests/App/Kernel.php index 7b022f9..0842e1b 100644 --- a/tests/App/Kernel.php +++ b/tests/App/Kernel.php @@ -24,21 +24,21 @@ public function registerBundles() */ public function registerContainerConfiguration(LoaderInterface $loader) { - $loader->load($this->rootDir . '/config/config.yaml'); - $clientConfig = $this->rootDir . '/config/config_' . $this->environment . '.yaml'; + $loader->load($this->getProjectDir() . '/tests/App/config/config.yaml'); + $clientConfig = $this->getProjectDir() . '/tests/App/config/config_' . $this->environment . '.yaml'; if (!file_exists($clientConfig)) { - $clientConfig = $this->rootDir . '/config/config_single_client.yaml'; + $clientConfig = $this->getProjectDir() . '/tests/App/config/config_single_client.yaml'; } $loader->load($clientConfig); } public function getCacheDir() { - return $this->rootDir . '/../../build/var/cache/' . $this->environment; + return $this->getProjectDir() . '/build/var/cache/' . $this->environment; } public function getLogDir() { - return $this->rootDir . '/../../build/var/logs/' . $this->environment; + return $this->getProjectDir() . '/build/var/logs/' . $this->environment; } }