Skip to content

Commit ab3a075

Browse files
authored
Merge pull request #35 from romainf/swap-4.0-symfony-5.0
Update to symfony 5.0
2 parents 67dfa1d + 19cc926 commit ab3a075

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

DependencyInjection/Configuration.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class Configuration implements ConfigurationInterface
2626
*/
2727
public function getConfigTreeBuilder()
2828
{
29-
$treeBuilder = new TreeBuilder('florianv_swap');
30-
31-
if (method_exists($treeBuilder, 'getRootNode')) {
29+
if (method_exists(TreeBuilder::class, 'getRootNode')) {
30+
$treeBuilder = new TreeBuilder('florianv_swap');
3231
$rootNode = $treeBuilder->getRootNode();
3332
} else {
33+
$treeBuilder = new TreeBuilder();
3434
$rootNode = $treeBuilder->root('florianv_swap');
3535
}
3636

@@ -199,15 +199,17 @@ public function getConfigTreeBuilder()
199199
return $treeBuilder;
200200
}
201201

202+
202203
private function createSimpleProviderNode($name)
203204
{
204-
$treeBuilder = new TreeBuilder($name);
205-
206-
if (method_exists($treeBuilder, 'getRootNode')) {
205+
if (method_exists(TreeBuilder::class, 'getRootNode')) {
206+
$treeBuilder = new TreeBuilder($name);
207207
$node = $treeBuilder->getRootNode();
208208
} else {
209+
$treeBuilder = new TreeBuilder();
209210
$node = $treeBuilder->root($name);
210211
}
212+
211213
$node
212214
->children()
213215
->integerNode('priority')->defaultValue(0)->end()

Tests/DependencyInjection/FlorianvSwapExtensionTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Swap\Builder;
1616
use Swap\Swap;
1717
use Symfony\Component\Cache\Adapter;
18-
use Symfony\Component\Cache\Traits\ApcuTrait;
18+
use Symfony\Component\Cache\Adapter\ApcuAdapter;
1919
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
2020
use Symfony\Component\DependencyInjection\ContainerBuilder;
2121
use Symfony\Component\DependencyInjection\Definition;
@@ -123,7 +123,7 @@ public function testArrayCache()
123123

124124
public function testApcuCache()
125125
{
126-
if (!ApcuTrait::isSupported()) {
126+
if (!ApcuAdapter::isSupported()) {
127127
$this->markTestSkipped('APCU is not enabled');
128128
}
129129

@@ -160,6 +160,7 @@ private function buildContainer(array $providers = ['fixer' => ['access_key' =>
160160
*
161161
* @param $class
162162
* @param $config
163+
* @throws \Exception
163164
*/
164165
private function assertCache($class, $config)
165166
{

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
},
1818
"require": {
1919
"php": "^5.6|^7.0",
20-
"symfony/framework-bundle": "~3.0 || ~4.0",
20+
"symfony/framework-bundle": "~3.0|~4.0|~5.0",
2121
"florianv/swap": "^4.0"
2222
},
2323
"require-dev": {
2424
"php-http/guzzle6-adapter": "^1.0",
2525
"php-http/message": "^1.7",
26-
"symfony/cache": "~3.0|~4.0",
26+
"symfony/cache": "~3.0|~4.0|~5.0",
2727
"phpunit/phpunit": "~5.0",
2828
"nyholm/psr7": "^1.1"
2929
},

0 commit comments

Comments
 (0)