1
0
mirror of synced 2025-01-31 04:21:44 +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
* @param array $definition
*/
public function setCustomGeneratorDefinition(array $definition) {
public function setCustomGeneratorDefinition(array $definition)
{
$this->customGeneratorDefinition = $definition;
}

View File

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

View File

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