Skip to content

Commit

Permalink
compatibility for symfony 5
Browse files Browse the repository at this point in the history
  • Loading branch information
pvsaintpe committed Feb 27, 2021
1 parent dc81bea commit 67fe59a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 13 deletions.
4 changes: 2 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('ltree_extension');
$treeBuilder = new TreeBuilder('ltree_extension');
$rootNode = $treeBuilder->getRootNode();

// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,25 @@ class TestRepository extends LTreeEntityRepository
}
```

3. Create Extension via migration
```php
public function up(Schema $schema) : void
{
$this->addSql('CREATE IF NOT EXISTS EXTENSION ltree');
}
...
```

4. Configure Doctrine Type via config (packages/doctrine.yaml):
```yaml
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
types:
ltree: LTree\Types\LTreeType
```
5. Configure Bundle via config (bundles.php):
```php
LTree\LTreeExtensionBundle::class => ['all' => true],
```
6 changes: 3 additions & 3 deletions Repository/LTreeChildrenInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
interface LTreeChildrenInterface
{
/**
* @param object|LTreeEntityInterface $children
* @param object|LTreeEntityInterface|LTreeChildrenInterface $children
* @return object
*/
public function addChildren($children);

/**
* @param object|LTreeEntityInterface $children
* @param object|LTreeEntityInterface|LTreeChildrenInterface $children
* @return object
*/
public function removeChildren($children);

/**
* @return ArrayCollection|object[]|LTreeEntityInterface[]
* @return ArrayCollection|object[]|LTreeEntityInterface[]|LTreeChildrenInterface[]
*/
public function getChildren();
}
4 changes: 2 additions & 2 deletions Repository/LTreeParentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
interface LTreeParentInterface
{
/**
* @param object|null|LTreeEntityInterface $parent
* @param object|null|LTreeEntityInterface|LTreeParentInterface $parent
* @return object
*/
public function setParent($parent);

/**
* @return object|null|LTreeEntityInterface
* @return object|null|LTreeEntityInterface|LTreeParentInterface
*/
public function getParent();
}
2 changes: 1 addition & 1 deletion Repository/LTreePathInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function getPath(): array;

/**
* @param array|null $path
* @return LTreeEntityInterface
* @return LTreeEntityInterface|LTreePathInterface
*/
public function setPath(?array $path);

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"type" : "symfony-bundle",
"homepage": "https://github.com/pvsaintpe/ltree-bundle",
"license" : "MIT",
"keywords" : ["ltree", "postgresql", "symfony", "symfony4", "php73", "php", "nested"],
"keywords" : ["ltree", "postgresql", "symfony", "symfony4", "symfony5", "php8", "php", "nested"],
"authors" : [
{
"name" : "Veselov Pavel",
"email" : "[email protected]"
}
],
"require" : {
"php": "^7.1.3",
"symfony/orm-pack": "^1.0",
"symfony/property-access": "4.2.*"
"php": "^7.4|^8.0",
"symfony/orm-pack": "^1.0|^2.0",
"symfony/property-access": "^4.2|^5.0"
},
"autoload" : {
"psr-4" : {
Expand All @@ -28,7 +28,7 @@
"symfony": {
"id": "",
"allow-contrib": false,
"require": "4.2.*"
"require": "^4.3|^5.0"
}
}
}

0 comments on commit 67fe59a

Please sign in to comment.