Skip to content

Commit

Permalink
include constants
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Sep 22, 2016
1 parent 1a9d2b9 commit a7256b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -90,7 +89,7 @@ $settings = [
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => 'path/to/annotation/mappings',
],
],
Expand Down Expand Up @@ -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;
Expand All @@ -134,7 +132,7 @@ $settings = [
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => 'path/to/annotation/mappings',
],
],
Expand All @@ -145,7 +143,7 @@ $settings = [
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => 'path/to/annotation/mappings',
],
],
Expand Down
5 changes: 5 additions & 0 deletions src/ManagerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
*/
Expand Down
17 changes: 8 additions & 9 deletions tests/Doctrine/ManagerBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -31,7 +30,7 @@ public function testSingleManagers()
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => __DIR__,
],
],
Expand All @@ -43,7 +42,7 @@ public function testSingleManagers()
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => __DIR__,
],
],
Expand All @@ -55,7 +54,7 @@ public function testSingleManagers()
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => __DIR__,
],
],
Expand Down Expand Up @@ -93,7 +92,7 @@ public function testDuplicatedNamedManager()
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => __DIR__,
],
],
Expand All @@ -107,7 +106,7 @@ public function testDuplicatedNamedManager()
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => __DIR__,
],
],
Expand All @@ -134,7 +133,7 @@ public function testNoRegisteredManager()
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => __DIR__,
],
],
Expand Down Expand Up @@ -171,7 +170,7 @@ public function testCLIApplication()
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => __DIR__,
],
],
Expand All @@ -185,7 +184,7 @@ public function testCLIApplication()
],
'metadata_mapping' => [
[
'type' => Builder::METADATA_MAPPING_ANNOTATION,
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => __DIR__,
],
],
Expand Down

0 comments on commit a7256b0

Please sign in to comment.