Skip to content

Commit

Permalink
Merge pull request #35 from romainf/swap-4.0-symfony-5.0
Browse files Browse the repository at this point in the history
Update to symfony 5.0
  • Loading branch information
florianv committed Mar 4, 2020
2 parents 67dfa1d + 19cc926 commit ab3a075
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
14 changes: 8 additions & 6 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('florianv_swap');

if (method_exists($treeBuilder, 'getRootNode')) {
if (method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('florianv_swap');
$rootNode = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('florianv_swap');
}

Expand Down Expand Up @@ -199,15 +199,17 @@ public function getConfigTreeBuilder()
return $treeBuilder;
}


private function createSimpleProviderNode($name)
{
$treeBuilder = new TreeBuilder($name);

if (method_exists($treeBuilder, 'getRootNode')) {
if (method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder($name);
$node = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root($name);
}

$node
->children()
->integerNode('priority')->defaultValue(0)->end()
Expand Down
5 changes: 3 additions & 2 deletions Tests/DependencyInjection/FlorianvSwapExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Swap\Builder;
use Swap\Swap;
use Symfony\Component\Cache\Adapter;
use Symfony\Component\Cache\Traits\ApcuTrait;
use Symfony\Component\Cache\Adapter\ApcuAdapter;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
Expand Down Expand Up @@ -123,7 +123,7 @@ public function testArrayCache()

public function testApcuCache()
{
if (!ApcuTrait::isSupported()) {
if (!ApcuAdapter::isSupported()) {
$this->markTestSkipped('APCU is not enabled');
}

Expand Down Expand Up @@ -160,6 +160,7 @@ private function buildContainer(array $providers = ['fixer' => ['access_key' =>
*
* @param $class
* @param $config
* @throws \Exception
*/
private function assertCache($class, $config)
{
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
},
"require": {
"php": "^5.6|^7.0",
"symfony/framework-bundle": "~3.0 || ~4.0",
"symfony/framework-bundle": "~3.0|~4.0|~5.0",
"florianv/swap": "^4.0"
},
"require-dev": {
"php-http/guzzle6-adapter": "^1.0",
"php-http/message": "^1.7",
"symfony/cache": "~3.0|~4.0",
"symfony/cache": "~3.0|~4.0|~5.0",
"phpunit/phpunit": "~5.0",
"nyholm/psr7": "^1.1"
},
Expand Down

0 comments on commit ab3a075

Please sign in to comment.