1
0
mirror of synced 2025-01-18 22:41:43 +03:00

Removing Doctrine\ORM\Mapping\Driver\Driver interface

Interface has been moved to Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
This commit is contained in:
Marco Pivetta 2012-01-17 17:58:56 +01:00
parent 5b97357402
commit 905acf9176
6 changed files with 16 additions and 17 deletions

View File

@ -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()
{

View File

@ -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;

View File

@ -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 <roman@code-factory.org>
* @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;
}

View File

@ -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)
{

View File

@ -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'))

View File

@ -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')));