diff --git a/README.md b/README.md index 8d13520..2afbcfd 100755 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ Install with Composer: ```json { - "require": { - "myclabs/deep-copy": "*" - } + "require": { + "myclabs/deep-copy": "*" + } } ``` @@ -131,13 +131,13 @@ $myCopy = $deepCopy->copy($myObject); // $myCopy->category has not been touched ``` -#### Doctrine `CollectionFilter` +#### `DoctrineCollectionFilter` -If you use Doctrine and want to copy an entity, you will need to use the `CollectionFilter`: +If you use Doctrine and want to copy an entity, you will need to use the `DoctrineCollectionFilter`: ```php $deepCopy = new DeepCopy(); -$deepCopy->addFilter(new CollectionFilter(), new PropertyTypeMatcher('Doctrine\Common\Collections\Collection')); +$deepCopy->addFilter(new DoctrineCollectionFilter(), new PropertyTypeMatcher('Doctrine\Common\Collections\Collection')); $myCopy = $deepCopy->copy($myObject); ``` diff --git a/src/DeepCopy/Filter/Doctrine/CollectionFilter.php b/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php similarity index 93% rename from src/DeepCopy/Filter/Doctrine/CollectionFilter.php rename to src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php index bac7ab6..28562ed 100755 --- a/src/DeepCopy/Filter/Doctrine/CollectionFilter.php +++ b/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php @@ -8,7 +8,7 @@ /** * Set a null value for a property */ -class CollectionFilter implements Filter +class DoctrineCollectionFilter implements Filter { /** * {@inheritdoc} diff --git a/tests/DeepCopyTest/Filter/Doctrine/CollectionFilterTest.php b/tests/DeepCopyTest/Filter/Doctrine/CollectionFilterTest.php index 0697620..7f7eb7a 100755 --- a/tests/DeepCopyTest/Filter/Doctrine/CollectionFilterTest.php +++ b/tests/DeepCopyTest/Filter/Doctrine/CollectionFilterTest.php @@ -3,7 +3,7 @@ namespace DeepCopyTest\Filter\Doctrine; use DeepCopy\DeepCopy; -use DeepCopy\Filter\Doctrine\CollectionFilter; +use DeepCopy\Filter\Doctrine\DoctrineCollectionFilter; use DeepCopy\Matcher\PropertyMatcher; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; @@ -20,7 +20,7 @@ public function testApply() $oldCollection->add(new \stdClass()); $object->foo = $oldCollection; - $filter = new CollectionFilter(); + $filter = new DoctrineCollectionFilter(); $filter->apply($object, 'foo', function($item) { return null; }); @@ -39,7 +39,7 @@ public function testIntegration() $o->property1 = $oldCollection; $deepCopy = new DeepCopy(); - $deepCopy->addFilter(new CollectionFilter(), new PropertyMatcher(get_class($o), 'property1')); + $deepCopy->addFilter(new DoctrineCollectionFilter(), new PropertyMatcher(get_class($o), 'property1')); /** @var CollectionFilterTestFixture $new */ $new = $deepCopy->copy($o);