Skip to content

Commit

Permalink
Merge pull request #78 from szymach/2.0
Browse files Browse the repository at this point in the history
Resolved Symfony 4.x depreciation
  • Loading branch information
rn0 authored Aug 6, 2019
2 parents 39fcb82 + 5e4fcde commit adfa49c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ class Configuration implements ConfigurationInterface

public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('fsi_resource_repository');
if (true === method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('fsi_resource_repository');
$rootNode = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('fsi_resource_repository');
}

$rootNode->children()
->scalarNode('db_driver')
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"phpunit/phpunit": "^7.1",
"phpspec/phpspec": "^5.0",
"phpspec/prophecy": "^1.7",
"sebastian/exporter": "^3.1.0"
"sebastian/exporter": "^3.1.0",
"symfony/phpunit-bridge": "^4.3"
},
"suggest": {
"fsi/doctrine-extensions-bundle": "For using fsi_file resource type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ function it_should_add_resource_map_parameter_to_container(ContainerBuilder $bui
$builder->setAlias(ResourceValueRepository::class, Argument::type(Alias::class))->shouldBeCalled();
$builder->setAlias('fsi_resource_repository.repository', Argument::type(Alias::class))->shouldBeCalled();
$builder->setAlias(Repository::class, Argument::type(Alias::class))->shouldBeCalled();
if (true === method_exists(ContainerBuilder::class, 'removeBindings')) {
$builder->removeBindings(Argument::type('string'))->shouldBeCalled();
}

$this->load([['db_driver' => 'orm', 'resource_class' => Resource::class]], $builder);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Repository/MapBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use FSi\Bundle\ResourceRepositoryBundle\Repository\Resource\Type\TextType;
use PHPUnit\Framework\TestCase;

class MapBuilderTest extends TestCase
final class MapBuilderTest extends TestCase
{
public function testNonExistantMap()
{
Expand Down

0 comments on commit adfa49c

Please sign in to comment.