diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 71a52d9..129702d 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -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 diff --git a/README.md b/README.md index c9fc462..03ed9f0 100644 --- a/README.md +++ b/README.md @@ -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], +``` diff --git a/Repository/LTreeChildrenInterface.php b/Repository/LTreeChildrenInterface.php index 9c9b5dd..e07330b 100644 --- a/Repository/LTreeChildrenInterface.php +++ b/Repository/LTreeChildrenInterface.php @@ -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(); } diff --git a/Repository/LTreeParentInterface.php b/Repository/LTreeParentInterface.php index 58f6f55..112d3c9 100644 --- a/Repository/LTreeParentInterface.php +++ b/Repository/LTreeParentInterface.php @@ -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(); } diff --git a/Repository/LTreePathInterface.php b/Repository/LTreePathInterface.php index 21ffe76..624cb76 100644 --- a/Repository/LTreePathInterface.php +++ b/Repository/LTreePathInterface.php @@ -15,7 +15,7 @@ public function getPath(): array; /** * @param array|null $path - * @return LTreeEntityInterface + * @return LTreeEntityInterface|LTreePathInterface */ public function setPath(?array $path); diff --git a/composer.json b/composer.json index 64bb3a8..0b2c24c 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "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", @@ -12,9 +12,9 @@ } ], "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" : { @@ -28,7 +28,7 @@ "symfony": { "id": "", "allow-contrib": false, - "require": "4.2.*" + "require": "^4.3|^5.0" } } }