1
0
mirror of synced 2025-01-31 12:32:59 +03:00

Remove trailing whitespaces and fix brace locations

This commit is contained in:
Vitali Yakavenka 2011-11-30 00:20:00 +03:00
parent f13f44a2fc
commit 353ba4dfd1
6 changed files with 58 additions and 46 deletions

View File

@ -1833,7 +1833,8 @@ class ClassMetadataInfo implements ClassMetadata
* Sets definition * Sets definition
* @param array $definition * @param array $definition
*/ */
public function setCustomGeneratorDefinition(array $definition) { public function setCustomGeneratorDefinition(array $definition)
{
$this->customGeneratorDefinition = $definition; $this->customGeneratorDefinition = $definition;
} }

View File

@ -23,7 +23,8 @@ namespace Doctrine\ORM\Mapping;
* @Annotation * @Annotation
* @Target("PROPERTY") * @Target("PROPERTY")
*/ */
final class CustomIdGenerator implements Annotation { final class CustomIdGenerator implements Annotation
{
/** @var string */ /** @var string */
public $class; public $class;
/** @var array */ /** @var array */

View File

@ -48,7 +48,8 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase
$this->assertEquals(ClassMetadata::GENERATOR_TYPE_SEQUENCE, $cm1->generatorType); $this->assertEquals(ClassMetadata::GENERATOR_TYPE_SEQUENCE, $cm1->generatorType);
} }
public function testGetMetadataFor_ReturnsLoadedCustomIdGenerator() { public function testGetMetadataFor_ReturnsLoadedCustomIdGenerator()
{
$cm1 = $this->_createValidClassMetadata(); $cm1 = $this->_createValidClassMetadata();
$cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM); $cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM);
$cm1->customGeneratorDefinition = array( $cm1->customGeneratorDefinition = array(
@ -64,7 +65,8 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase
$actual->idGenerator); $actual->idGenerator);
} }
public function testGetMetadataFor_PasesArgumentsToGeneratorsConstructor() { public function testGetMetadataFor_PasesArgumentsToGeneratorsConstructor()
{
$cm1 = $this->_createValidClassMetadata(); $cm1 = $this->_createValidClassMetadata();
$cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM); $cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM);
$cm1->customGeneratorDefinition = array( $cm1->customGeneratorDefinition = array(
@ -81,7 +83,8 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase
$this->assertEquals($expected, $actual->idGenerator); $this->assertEquals($expected, $actual->idGenerator);
} }
public function testGetMetadataFor_ThrowsExceptionOnUnknownCustomGeneratorClass() { public function testGetMetadataFor_ThrowsExceptionOnUnknownCustomGeneratorClass()
{
$cm1 = $this->_createValidClassMetadata(); $cm1 = $this->_createValidClassMetadata();
$cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM); $cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM);
$cm1->customGeneratorDefinition = array("class" => "NotExistingGenerator"); $cm1->customGeneratorDefinition = array("class" => "NotExistingGenerator");
@ -92,7 +95,8 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase
$actual = $cmf->getMetadataFor($cm1->name); $actual = $cmf->getMetadataFor($cm1->name);
} }
public function testGetMetadataFor_ThrowsExceptionOnMissingCustomGeneratorDefinition() { public function testGetMetadataFor_ThrowsExceptionOnMissingCustomGeneratorDefinition()
{
$cm1 = $this->_createValidClassMetadata(); $cm1 = $this->_createValidClassMetadata();
$cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM); $cm1->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_CUSTOM);
$cmf = $this->_createTestFactory(); $cmf = $this->_createTestFactory();
@ -183,7 +187,8 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase
/** /**
* @return ClassMetadataFactoryTestSubject * @return ClassMetadataFactoryTestSubject
*/ */
protected function _createTestFactory() { protected function _createTestFactory()
{
$mockDriver = new MetadataDriverMock(); $mockDriver = new MetadataDriverMock();
$entityManager = $this->_createEntityManager($mockDriver); $entityManager = $this->_createEntityManager($mockDriver);
$cmf = new ClassMetadataFactoryTestSubject(); $cmf = new ClassMetadataFactoryTestSubject();
@ -195,7 +200,8 @@ class ClassMetadataFactoryTest extends \Doctrine\Tests\OrmTestCase
* @param string $class * @param string $class
* @return ClassMetadata * @return ClassMetadata
*/ */
protected function _createValidClassMetadata() { protected function _createValidClassMetadata()
{
$cm1 = new ClassMetadata('Doctrine\Tests\ORM\Mapping\TestEntity1'); $cm1 = new ClassMetadata('Doctrine\Tests\ORM\Mapping\TestEntity1');
$cm1->setPrimaryTable(array('name' => '`group`')); $cm1->setPrimaryTable(array('name' => '`group`'));
// Add a mapped field // Add a mapped field
@ -250,10 +256,14 @@ class TestEntity1
private $association; private $association;
} }
class CustomIdGenerator extends \Doctrine\ORM\Id\AbstractIdGenerator { class CustomIdGenerator extends \Doctrine\ORM\Id\AbstractIdGenerator
{
public $parameter; public $parameter;
public function __construct($parameter = null) { public function __construct($parameter = null)
{
$this->parameter = $parameter; $this->parameter = $parameter;
} }
public function generate(\Doctrine\ORM\EntityManager $em, $entity) {} public function generate(\Doctrine\ORM\EntityManager $em, $entity)
{
}
} }