diff --git a/src/DI/OrmExtension.php b/src/DI/OrmExtension.php index 287da71..a35b353 100644 --- a/src/DI/OrmExtension.php +++ b/src/DI/OrmExtension.php @@ -41,7 +41,7 @@ * repositoryFactory: string|Statement|null, * defaultQueryHints: array, * filters: array, - * mapping: array, + * mapping: array, * defaultCache: string|Statement|null, * queryCache: string|Statement|null, * resultCache: string|Statement|null, @@ -123,8 +123,8 @@ public function getConfigSchema(): Schema ), 'mapping' => Expect::arrayOf( Expect::structure([ - 'type' => Expect::anyOf('attributes', 'xml')->required(), - 'dirs' => Expect::listOf(Expect::string())->min(1)->required(), + 'type' => Expect::anyOf('attributes', 'xml')->default('attributes'), + 'directories' => Expect::listOf(Expect::string())->min(1)->required(), 'namespace' => Expect::string()->required(), ]), Expect::string() diff --git a/src/DI/Pass/ManagerPass.php b/src/DI/Pass/ManagerPass.php index ba93cae..d091f76 100644 --- a/src/DI/Pass/ManagerPass.php +++ b/src/DI/Pass/ManagerPass.php @@ -267,12 +267,12 @@ public function loadManagerConfiguration(string $managerName, mixed $managerConf foreach ($managerConfig->mapping as $mapping) { if ($mapping->type === 'attributes') { $mappingDriver->addSetup('addDriver', [ - new Statement(AttributeDriver::class, [array_values($mapping->dirs)]), + new Statement(AttributeDriver::class, [array_values($mapping->directories)]), $mapping->namespace, ]); } elseif ($mapping->type === 'xml') { $mappingDriver->addSetup('addDriver', [ - new Statement(SimplifiedXmlDriver::class, [array_combine($mapping->dirs, array_fill(0, count($mapping->dirs), $mapping->namespace))]), + new Statement(SimplifiedXmlDriver::class, [array_combine($mapping->directories, array_fill(0, count($mapping->directories), $mapping->namespace))]), $mapping->namespace, ]); } else { diff --git a/tests/Cases/DI/Helper/MappingHelper.phpt b/tests/Cases/DI/Helper/MappingHelper.phpt index 88b0e7e..7600a7f 100644 --- a/tests/Cases/DI/Helper/MappingHelper.phpt +++ b/tests/Cases/DI/Helper/MappingHelper.phpt @@ -62,7 +62,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [%fixturesDir%/Entity] + directories: [%fixturesDir%/Entity] namespace: Tests\Mocks NEON )); diff --git a/tests/Cases/DI/OrmExtension.cache.phpt b/tests/Cases/DI/OrmExtension.cache.phpt index 7dd871e..fe03f34 100644 --- a/tests/Cases/DI/OrmExtension.cache.phpt +++ b/tests/Cases/DI/OrmExtension.cache.phpt @@ -41,7 +41,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -90,7 +90,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -137,7 +137,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database services: @@ -184,7 +184,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -238,7 +238,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database services: @@ -289,7 +289,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); diff --git a/tests/Cases/DI/OrmExtension.configuration.phpt b/tests/Cases/DI/OrmExtension.configuration.phpt index ad16578..866e6e3 100644 --- a/tests/Cases/DI/OrmExtension.configuration.phpt +++ b/tests/Cases/DI/OrmExtension.configuration.phpt @@ -42,7 +42,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [%fixturesDir%/Entity] + directories: [%fixturesDir%/Entity] namespace: Tests\Mocks\Entity NEON )); diff --git a/tests/Cases/DI/OrmExtension.entityManager.phpt b/tests/Cases/DI/OrmExtension.entityManager.phpt index 33dae46..12b31eb 100644 --- a/tests/Cases/DI/OrmExtension.entityManager.phpt +++ b/tests/Cases/DI/OrmExtension.entityManager.phpt @@ -41,7 +41,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -81,7 +81,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); diff --git a/tests/Cases/DI/OrmExtension.events.phpt b/tests/Cases/DI/OrmExtension.events.phpt index abb8d1a..788be89 100644 --- a/tests/Cases/DI/OrmExtension.events.phpt +++ b/tests/Cases/DI/OrmExtension.events.phpt @@ -42,7 +42,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -82,7 +82,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database services: diff --git a/tests/Cases/DI/OrmExtension.filters.phpt b/tests/Cases/DI/OrmExtension.filters.phpt index b4bb4d9..8572adb 100644 --- a/tests/Cases/DI/OrmExtension.filters.phpt +++ b/tests/Cases/DI/OrmExtension.filters.phpt @@ -45,7 +45,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); diff --git a/tests/Cases/DI/OrmExtension.mapping.phpt b/tests/Cases/DI/OrmExtension.mapping.phpt index 924e38c..ceeca44 100644 --- a/tests/Cases/DI/OrmExtension.mapping.phpt +++ b/tests/Cases/DI/OrmExtension.mapping.phpt @@ -44,7 +44,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [%fixturesDir%/Entity, %fixturesDir%/../Toolkit] + directories: [%fixturesDir%/Entity, %fixturesDir%/../Toolkit] namespace: Tests\Fixtures\Dummy NEON )); @@ -91,7 +91,7 @@ Toolkit::test(function (): void { mapping: App: type: xml - dirs: [%fixturesDir%/Entity, %fixturesDir%/../Toolkit] + directories: [%fixturesDir%/Entity, %fixturesDir%/../Toolkit] namespace: Tests\Mocks\Dummy NEON )); @@ -138,11 +138,11 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [%fixturesDir%/Entity, %fixturesDir%/../Toolkit] + directories: [%fixturesDir%/Entity, %fixturesDir%/../Toolkit] namespace: Tests\Mocks\Entity AppModule: type: xml - dirs: [%fixturesDir%/Entity, %fixturesDir%/../Toolkit] + directories: [%fixturesDir%/Entity, %fixturesDir%/../Toolkit] namespace: App\Module NEON )); diff --git a/tests/Cases/DI/OrmExtension.phpt b/tests/Cases/DI/OrmExtension.phpt index f9c42fa..cf06716 100644 --- a/tests/Cases/DI/OrmExtension.phpt +++ b/tests/Cases/DI/OrmExtension.phpt @@ -39,7 +39,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); diff --git a/tests/Cases/DI/OrmExtension.proxy.phpt b/tests/Cases/DI/OrmExtension.proxy.phpt index 99fc953..fdf4ce2 100644 --- a/tests/Cases/DI/OrmExtension.proxy.phpt +++ b/tests/Cases/DI/OrmExtension.proxy.phpt @@ -40,7 +40,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -81,7 +81,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -122,7 +122,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); diff --git a/tests/Cases/DI/OrmExtension.resolveTargetEntity.php b/tests/Cases/DI/OrmExtension.resolveTargetEntity.php index 57e5ca1..fcdb6fc 100644 --- a/tests/Cases/DI/OrmExtension.resolveTargetEntity.php +++ b/tests/Cases/DI/OrmExtension.resolveTargetEntity.php @@ -44,7 +44,7 @@ mapping: App: type: attributes - dirs: [%fixturesDir%/Entity] + directories: [%fixturesDir%/Entity] namespace: Tests\Mocks\Entity NEON )); diff --git a/tests/Cases/DI/OrmExtension.services.phpt b/tests/Cases/DI/OrmExtension.services.phpt index 773ec0a..8737411 100644 --- a/tests/Cases/DI/OrmExtension.services.phpt +++ b/tests/Cases/DI/OrmExtension.services.phpt @@ -45,7 +45,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -92,7 +92,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database services: entityListenerResolver: Doctrine\ORM\Mapping\DefaultEntityListenerResolver() @@ -144,7 +144,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -191,7 +191,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); diff --git a/tests/Cases/ManagerRegistry.phpt b/tests/Cases/ManagerRegistry.phpt index ede22fd..7ad8bc6 100644 --- a/tests/Cases/ManagerRegistry.phpt +++ b/tests/Cases/ManagerRegistry.phpt @@ -45,14 +45,14 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database second: connection: second mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON )); @@ -98,7 +98,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database second: connection: second @@ -106,7 +106,7 @@ Toolkit::test(function (): void { mapping: App: type: attributes - dirs: [app/Database] + directories: [app/Database] namespace: App\Database NEON ));