From 9174342344b70a0bca61e7548fb3c9044c3f864b Mon Sep 17 00:00:00 2001 From: Piotr Szymaszek Date: Tue, 6 Aug 2019 16:46:23 +0200 Subject: [PATCH] Fixed Symfony 4.x deprecation --- .gitignore | 4 +--- .travis.yml | 11 +++-------- DependencyInjection/Configuration.php | 9 +++++++-- composer.json | 4 ++-- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 440b211..d069e29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -/vendor +vendor composer.lock composer.phar -autoload.php -bin \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index c87cda5..86359e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,15 @@ language: php -sudo: false - matrix: include: - php: 7.1 env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' - php: 7.3 -before_install: - - composer self-update - install: - composer update $COMPOSER_FLAGS script: - - bin/phpspec run -f pretty - - bin/phpstan analyze --level 5 - - bin/behat --no-snippets --verbose + - vendor/bin/phpspec run -f pretty + - vendor/bin/phpstan analyze --level 5 + - vendor/bin/behat --no-snippets --verbose diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 6252717..0c78e37 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -18,8 +18,13 @@ class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder(): TreeBuilder { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('fsi_teryt_db'); + if (true === method_exists(TreeBuilder::class, 'getRootNode')) { + $treeBuilder = new TreeBuilder('fsi_teryt_db'); + $rootNode = $treeBuilder->getRootNode(); + } else { + $treeBuilder = new TreeBuilder(); + $rootNode = $treeBuilder->root('fsi_teryt_db'); + } $rootNode ->children() diff --git a/composer.json b/composer.json index aa56770..b4fa861 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "fsi/teryt-database-bundle", "type": "symfony-bundle", "description": "Teryt database bundle", - "keywords": ["teryt", "bundle", "symfony2", "fsi"], + "keywords": ["teryt", "bundle", "symfony", "fsi"], "license": "MIT", "authors": [ { @@ -39,7 +39,7 @@ "phpstan/phpstan-doctrine": "^0.11.2" }, "config": { - "bin-dir": "bin" + "bin-dir": "vendor/bin" }, "autoload": { "psr-4": { "FSi\\Bundle\\TerytDatabaseBundle\\": "" }