forked from Spea/fixture-dumper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issues according to code review.
- Loading branch information
Showing
14 changed files
with
31 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,12 +23,13 @@ | |
* | ||
* @author Martin Parsiegla <[email protected]> | ||
*/ | ||
abstract class Dumper | ||
abstract class AbstractDumper | ||
{ | ||
|
||
/** | ||
* @var Generator\AbstractGenerator | ||
* @var \PhpCollection\MapInterface | ||
*/ | ||
protected $generator; | ||
protected $generators; | ||
|
||
/** | ||
* @var \Doctrine\Common\Persistence\ObjectManager | ||
|
@@ -104,7 +105,7 @@ public function setDumpMultipleFiles($dumpMultipleFiles) | |
/** | ||
* @return bool | ||
*/ | ||
public function getDumpMultipleFiles() | ||
public function shouldDumpMultipleFiles() | ||
{ | ||
return $this->dumpMultipleFiles; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
/** | ||
* @author Martin Parsiegla <[email protected]> | ||
*/ | ||
class DefaultNamingStrategy implements NamingStrategy | ||
class DefaultNamingStrategy implements NamingStrategyInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
/** | ||
* @author Martin Parsiegla <[email protected]> | ||
*/ | ||
interface NamingStrategy | ||
interface NamingStrategyInterface | ||
{ | ||
/** | ||
* Return a fixture class name for the given model class name. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
use InvalidArgumentException; | ||
use Doctrine\Common\Persistence\Mapping\ClassMetadata; | ||
use \Doctrine\ODM\MongoDB\Mapping\ClassMetadata as BaseClassMetadata; | ||
|
||
/** | ||
* @author Martin Parsiegla <[email protected]> | ||
|
@@ -30,7 +31,7 @@ class ClassMetadataProxy implements ClassMetadata | |
public $origFieldMappings; | ||
|
||
/** | ||
* @var \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo | ||
* @var \Doctrine\ODM\MongoDB\Mapping\ClassMetadata | ||
*/ | ||
protected $classMetadata; | ||
|
||
|
@@ -50,9 +51,9 @@ class ClassMetadataProxy implements ClassMetadata | |
protected $associationMappings = array(); | ||
|
||
/** | ||
* @param \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo $classMetadata | ||
* @param \Doctrine\ODM\MongoDB\Mapping\ClassMetadata $classMetadata | ||
*/ | ||
public function __construct(ClassMetadata $classMetadata) | ||
public function __construct(BaseClassMetadata $classMetadata) | ||
{ | ||
$this->name = $classMetadata->name; | ||
$this->origFieldMappings = $classMetadata->fieldMappings; | ||
|
@@ -97,7 +98,7 @@ public function getFieldNames() | |
* Initialize the mappings from the class metadata. | ||
* The mapping will be split in field mappings and association mappings. | ||
* | ||
* @return MongoODMClassMetadataProxy | ||
* @return \Sp\FixtureDumper\Mapping\MongoDB\ClassMetadataProxy | ||
*/ | ||
protected function initMappings() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
/** | ||
* @author Martin Parsiegla <[email protected]> | ||
*/ | ||
class MongoDBDumper extends Dumper | ||
class MongoDBDumper extends AbstractDumper | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
|
@@ -87,6 +87,7 @@ private function addDependencies(ClassMetadataProxy $class, CommitOrderCalculato | |
continue; | ||
} | ||
|
||
$newNodes = array(); | ||
foreach ($targetClass->subClasses as $subClassName) { | ||
$targetSubClass = $this->dm->getClassMetadata($subClassName); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
/** | ||
* @author Martin Parsiegla <[email protected]> | ||
*/ | ||
class ORMDumper extends Dumper | ||
class ORMDumper extends AbstractDumper | ||
{ | ||
protected function getDumpOrder(array $classes) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
/** | ||
* @author Martin Parsiegla <[email protected]> | ||
*/ | ||
class ClassUtils | ||
final class ClassUtils | ||
{ | ||
private function __construct() | ||
{} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters