diff --git a/README.md b/README.md index ef4a6e7..c3a053f 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,6 @@ In order to configure the different Doctrine manager builders head to [juliangut Register managers in the DI container as any other service. ```php -use Jgut\Doctrine\ManagerBuilder\ManagerBuilder as Builder; use Jgut\Slim\Doctrine\ManagerBuilder; use Slim\App; @@ -90,7 +89,7 @@ $settings = [ ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => 'path/to/annotation/mappings', ], ], @@ -119,7 +118,6 @@ $app->get('/', function () { Register manager builder in the DI container to delegate managers creation. ```php -use Jgut\Doctrine\ManagerBuilder\ManagerBuilder as Builder; use Jgut\Slim\Doctrine\ManagerBuilder; use Interop\Container\ContainerInterface; use Slim\App; @@ -134,7 +132,7 @@ $settings = [ ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => 'path/to/annotation/mappings', ], ], @@ -145,7 +143,7 @@ $settings = [ ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => 'path/to/annotation/mappings', ], ], diff --git a/src/ManagerBuilder.php b/src/ManagerBuilder.php index bb999e6..ed11878 100644 --- a/src/ManagerBuilder.php +++ b/src/ManagerBuilder.php @@ -20,6 +20,11 @@ */ class ManagerBuilder { + const METADATA_MAPPING_ANNOTATION = Builder::METADATA_MAPPING_ANNOTATION; + const METADATA_MAPPING_XML = Builder::METADATA_MAPPING_XML; + const METADATA_MAPPING_YAML = Builder::METADATA_MAPPING_YAML; + const METADATA_MAPPING_PHP = Builder::METADATA_MAPPING_PHP; + /** * @var Builder[] */ diff --git a/tests/Doctrine/ManagerBuilderTest.php b/tests/Doctrine/ManagerBuilderTest.php index fdd06ff..fdf2896 100644 --- a/tests/Doctrine/ManagerBuilderTest.php +++ b/tests/Doctrine/ManagerBuilderTest.php @@ -12,7 +12,6 @@ use Doctrine\ODM\CouchDB\DocumentManager as CouchDBDocumentManager; use Doctrine\ODM\MongoDB\DocumentManager as MongoDBDocumentManager; use Doctrine\ORM\EntityManager; -use Jgut\Doctrine\ManagerBuilder\ManagerBuilder as Builder; use Jgut\Doctrine\ManagerBuilder\RelationalBuilder; use Jgut\Slim\Doctrine\ManagerBuilder; @@ -31,7 +30,7 @@ public function testSingleManagers() ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => __DIR__, ], ], @@ -43,7 +42,7 @@ public function testSingleManagers() ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => __DIR__, ], ], @@ -55,7 +54,7 @@ public function testSingleManagers() ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => __DIR__, ], ], @@ -93,7 +92,7 @@ public function testDuplicatedNamedManager() ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => __DIR__, ], ], @@ -107,7 +106,7 @@ public function testDuplicatedNamedManager() ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => __DIR__, ], ], @@ -134,7 +133,7 @@ public function testNoRegisteredManager() ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => __DIR__, ], ], @@ -171,7 +170,7 @@ public function testCLIApplication() ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => __DIR__, ], ], @@ -185,7 +184,7 @@ public function testCLIApplication() ], 'metadata_mapping' => [ [ - 'type' => Builder::METADATA_MAPPING_ANNOTATION, + 'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION, 'path' => __DIR__, ], ],