From 905acf9176618a50989f54f6efbaa379d5a02c9e Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Tue, 17 Jan 2012 17:58:56 +0100 Subject: [PATCH] Removing Doctrine\ORM\Mapping\Driver\Driver interface Interface has been moved to Doctrine\Common\Persistence\Mapping\Driver\MappingDriver --- lib/Doctrine/ORM/Configuration.php | 8 ++++---- lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php | 2 +- lib/Doctrine/ORM/Mapping/Driver/DriverChain.php | 8 ++++---- tests/Doctrine/Tests/Mocks/MetadataDriverMock.php | 2 +- .../Tests/ORM/Mapping/ClassMetadataFactoryTest.php | 4 ++-- tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php | 9 ++++----- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php index ff7ea63da..554f77f66 100644 --- a/lib/Doctrine/ORM/Configuration.php +++ b/lib/Doctrine/ORM/Configuration.php @@ -23,7 +23,7 @@ use Doctrine\Common\Cache\Cache, Doctrine\Common\Cache\ArrayCache, Doctrine\Common\Annotations\AnnotationRegistry, Doctrine\Common\Annotations\AnnotationReader, - Doctrine\ORM\Mapping\Driver\Driver, + Doctrine\Common\Persistence\Mapping\Driver\MappingDriver, Doctrine\ORM\Mapping\Driver\AnnotationDriver, Doctrine\ORM\Mapping\QuoteStrategy, Doctrine\ORM\Mapping\DefaultQuoteStrategy, @@ -114,11 +114,11 @@ class Configuration extends \Doctrine\DBAL\Configuration /** * Sets the cache driver implementation that is used for metadata caching. * - * @param Driver $driverImpl + * @param MappingDriver $driverImpl * @todo Force parameter to be a Closure to ensure lazy evaluation * (as soon as a metadata cache is in effect, the driver never needs to initialize). */ - public function setMetadataDriverImpl(Driver $driverImpl) + public function setMetadataDriverImpl(MappingDriver $driverImpl) { $this->_attributes['metadataDriverImpl'] = $driverImpl; } @@ -217,7 +217,7 @@ class Configuration extends \Doctrine\DBAL\Configuration * Gets the cache driver implementation that is used for the mapping metadata. * * @throws ORMException - * @return Mapping\Driver\Driver + * @return MappingDriver */ public function getMetadataDriverImpl() { diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index 378f1cc98..6f8ee80b2 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -53,7 +53,7 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface private $targetPlatform; /** - * @var \Doctrine\ORM\Mapping\Driver\Driver + * @var \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver */ private $driver; diff --git a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php b/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php index 8536d7365..267e9d534 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM\Mapping\Driver; -use Doctrine\ORM\Mapping\Driver\Driver, +use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver, Doctrine\Common\Persistence\Mapping\ClassMetadata, Doctrine\ORM\Mapping\MappingException; @@ -34,7 +34,7 @@ use Doctrine\ORM\Mapping\Driver\Driver, * @author Roman Borschel * @todo Rename: MappingDriverChain or MetadataDriverChain */ -class DriverChain implements Driver +class DriverChain implements MappingDriver { /** * @var array @@ -71,10 +71,10 @@ class DriverChain implements Driver /** * Add a nested driver. * - * @param Driver $nestedDriver + * @param MappingDriver $nestedDriver * @param string $namespace */ - public function addDriver(Driver $nestedDriver, $namespace) + public function addDriver(MappingDriver $nestedDriver, $namespace) { $this->drivers[$namespace] = $nestedDriver; } diff --git a/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php b/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php index 87f560e64..3dfb5e3a9 100644 --- a/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php +++ b/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php @@ -2,7 +2,7 @@ namespace Doctrine\Tests\Mocks; -class MetadataDriverMock implements \Doctrine\ORM\Mapping\Driver\Driver +class MetadataDriverMock implements \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver { public function loadMetadataForClass($className, \Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata) { diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php index f1654dcfd..100e4df85 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php @@ -114,7 +114,7 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase public function testIsTransient() { $cmf = new ClassMetadataFactory(); - $driver = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); + $driver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); $driver->expects($this->at(0)) ->method('isTransient') ->with($this->equalTo('Doctrine\Tests\Models\CMS\CmsUser')) @@ -136,7 +136,7 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase public function testIsTransientEntityNamespace() { $cmf = new ClassMetadataFactory(); - $driver = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); + $driver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); $driver->expects($this->at(0)) ->method('isTransient') ->with($this->equalTo('Doctrine\Tests\Models\CMS\CmsUser')) diff --git a/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php b/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php index 35560f35a..f5fd60a60 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/DriverChainTest.php @@ -2,7 +2,6 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\ORM\Mapping\Driver\Driver; use Doctrine\ORM\Mapping\Driver\DriverChain; require_once __DIR__ . '/../../TestInit.php'; @@ -16,13 +15,13 @@ class DriverChainTest extends \Doctrine\Tests\OrmTestCase $chain = new DriverChain(); - $driver1 = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); + $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); $driver1->expects($this->never()) ->method('loadMetadataForClass'); $driver1->expectS($this->never()) ->method('isTransient'); - $driver2 = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); + $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); $driver2->expects($this->at(0)) ->method('loadMetadataForClass') ->with($this->equalTo($className), $this->equalTo($classMetadata)); @@ -57,12 +56,12 @@ class DriverChainTest extends \Doctrine\Tests\OrmTestCase $chain = new DriverChain(); - $driver1 = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); + $driver1 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); $driver1->expects($this->once()) ->method('getAllClassNames') ->will($this->returnValue(array('Doctrine\Tests\Models\Company\Foo'))); - $driver2 = $this->getMock('Doctrine\ORM\Mapping\Driver\Driver'); + $driver2 = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); $driver2->expects($this->once()) ->method('getAllClassNames') ->will($this->returnValue(array('Doctrine\Tests\ORM\Mapping\Bar', 'Doctrine\Tests\ORM\Mapping\Baz', 'FooBarBaz')));