@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | protected $name; |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * @ManyToMany(targetEntity="DDC211Group", inversedBy="users") |
|
| 71 | - * @JoinTable(name="user_groups", |
|
| 72 | - * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}, |
|
| 73 | - * inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id")} |
|
| 74 | - * ) |
|
| 75 | - */ |
|
| 70 | + * @ManyToMany(targetEntity="DDC211Group", inversedBy="users") |
|
| 71 | + * @JoinTable(name="user_groups", |
|
| 72 | + * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}, |
|
| 73 | + * inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id")} |
|
| 74 | + * ) |
|
| 75 | + */ |
|
| 76 | 76 | protected $groups; |
| 77 | 77 | |
| 78 | 78 | public function __construct() { |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | protected $name; |
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | - * @ManyToMany(targetEntity="DDC211User", mappedBy="groups") |
|
| 107 | - */ |
|
| 106 | + * @ManyToMany(targetEntity="DDC211User", mappedBy="groups") |
|
| 107 | + */ |
|
| 108 | 108 | protected $users; |
| 109 | 109 | |
| 110 | 110 | public function __construct() { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $this->_em->persist($group); |
| 36 | 36 | $this->_em->flush(); |
| 37 | 37 | |
| 38 | - if (!$user->getGroups()->contains($group)) { |
|
| 38 | + if ( ! $user->getGroups()->contains($group)) { |
|
| 39 | 39 | $user->getGroups()->add($group); |
| 40 | 40 | $group->getUsers()->add($user); |
| 41 | 41 | $this->_em->flush(); |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function convertToDatabaseValue($value, AbstractPlatform $platform) |
| 73 | 73 | { |
| 74 | - return (string)$value; |
|
| 74 | + return (string) $value; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | public function convertToPhpValue($value, AbstractPlatform $platform) |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | $this->_em->getClassMetadata(DDC960Child::class) |
| 17 | 17 | ] |
| 18 | 18 | ); |
| 19 | - } catch(\Exception $e) { |
|
| 19 | + } catch (\Exception $e) { |
|
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $this->_em->getClassMetadata(DDC2759MetadataCategory::class), |
| 24 | 24 | ] |
| 25 | 25 | ); |
| 26 | - } catch(\Exception $e) { |
|
| 26 | + } catch (\Exception $e) { |
|
| 27 | 27 | return; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | |
| 55 | 55 | // Checks sequence name validity |
| 56 | 56 | $this->assertEquals( |
| 57 | - $fullTableName . '_' . $classMetadata->getSingleIdentifierColumnName() . '_seq', |
|
| 57 | + $fullTableName.'_'.$classMetadata->getSingleIdentifierColumnName().'_seq', |
|
| 58 | 58 | $classMetadata->getSequenceName($platform) |
| 59 | 59 | ); |
| 60 | 60 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | $this->_em->getClassMetadata(DDC735Review::class) |
| 17 | 17 | ] |
| 18 | 18 | ); |
| 19 | - } catch(\Exception $e) { |
|
| 19 | + } catch (\Exception $e) { |
|
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | } |
@@ -46,11 +46,11 @@ |
||
| 46 | 46 | $this->_em->flush(); |
| 47 | 47 | $this->_em->clear(); |
| 48 | 48 | |
| 49 | - $dql = "SELECT a, b, ba FROM " . __NAMESPACE__ . "\DDC1452EntityA AS a LEFT JOIN a.entitiesB AS b LEFT JOIN b.entityATo AS ba"; |
|
| 49 | + $dql = "SELECT a, b, ba FROM ".__NAMESPACE__."\DDC1452EntityA AS a LEFT JOIN a.entitiesB AS b LEFT JOIN b.entityATo AS ba"; |
|
| 50 | 50 | $results = $this->_em->createQuery($dql)->setMaxResults(1)->getResult(); |
| 51 | 51 | |
| 52 | 52 | $this->assertSame($results[0], $results[0]->entitiesB[0]->entityAFrom); |
| 53 | - $this->assertFalse( $results[0]->entitiesB[0]->entityATo instanceof Proxy); |
|
| 53 | + $this->assertFalse($results[0]->entitiesB[0]->entityATo instanceof Proxy); |
|
| 54 | 54 | $this->assertInstanceOf(Collection::class, $results[0]->entitiesB[0]->entityATo->getEntitiesB()); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | public function testEntitySingleResult() |
| 21 | 21 | { |
| 22 | - $query = $this->_em->createQuery('SELECT d FROM ' . DateTimeModel::class . ' d'); |
|
| 22 | + $query = $this->_em->createQuery('SELECT d FROM '.DateTimeModel::class.' d'); |
|
| 23 | 23 | $datetime = $query->setMaxResults(1)->getSingleResult(); |
| 24 | 24 | |
| 25 | 25 | $this->assertInstanceOf(DateTimeModel::class, $datetime); |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | public function testScalarResult() |
| 33 | 33 | { |
| 34 | - $query = $this->_em->createQuery('SELECT d.id, d.time, d.date, d.datetime FROM ' . DateTimeModel::class . ' d ORDER BY d.date ASC'); |
|
| 34 | + $query = $this->_em->createQuery('SELECT d.id, d.time, d.date, d.datetime FROM '.DateTimeModel::class.' d ORDER BY d.date ASC'); |
|
| 35 | 35 | $result = $query->getScalarResult(); |
| 36 | 36 | |
| 37 | - $this->assertCount(2,$result); |
|
| 37 | + $this->assertCount(2, $result); |
|
| 38 | 38 | |
| 39 | 39 | $this->assertContains('11:11:11', $result[0]['time']); |
| 40 | 40 | $this->assertContains('2010-01-01', $result[0]['date']); |
@@ -47,10 +47,10 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | public function testaTicketEntityArrayResult() |
| 49 | 49 | { |
| 50 | - $query = $this->_em->createQuery('SELECT d FROM ' . DateTimeModel::class . ' d ORDER BY d.date ASC'); |
|
| 50 | + $query = $this->_em->createQuery('SELECT d FROM '.DateTimeModel::class.' d ORDER BY d.date ASC'); |
|
| 51 | 51 | $result = $query->getArrayResult(); |
| 52 | 52 | |
| 53 | - $this->assertCount(2,$result); |
|
| 53 | + $this->assertCount(2, $result); |
|
| 54 | 54 | |
| 55 | 55 | $this->assertInstanceOf('DateTime', $result[0]['datetime']); |
| 56 | 56 | $this->assertInstanceOf('DateTime', $result[0]['time']); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | public function testTicketSingleResult() |
| 65 | 65 | { |
| 66 | - $query = $this->_em->createQuery('SELECT d.id, d.time, d.date, d.datetime FROM ' . DateTimeModel::class . ' d ORDER BY d.date ASC'); |
|
| 66 | + $query = $this->_em->createQuery('SELECT d.id, d.time, d.date, d.datetime FROM '.DateTimeModel::class.' d ORDER BY d.date ASC'); |
|
| 67 | 67 | $datetime = $query->setMaxResults(1)->getSingleResult(); |
| 68 | 68 | |
| 69 | 69 | $this->assertTrue(is_array($datetime)); |
@@ -75,10 +75,10 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function testTicketResult() |
| 77 | 77 | { |
| 78 | - $query = $this->_em->createQuery('SELECT d.id, d.time, d.date, d.datetime FROM ' . DateTimeModel::class . ' d ORDER BY d.date ASC'); |
|
| 78 | + $query = $this->_em->createQuery('SELECT d.id, d.time, d.date, d.datetime FROM '.DateTimeModel::class.' d ORDER BY d.date ASC'); |
|
| 79 | 79 | $result = $query->getResult(); |
| 80 | 80 | |
| 81 | - $this->assertCount(2,$result); |
|
| 81 | + $this->assertCount(2, $result); |
|
| 82 | 82 | |
| 83 | 83 | $this->assertInstanceOf('DateTime', $result[0]['time']); |
| 84 | 84 | $this->assertInstanceOf('DateTime', $result[0]['date']); |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | $dateTime1->date = new \DateTime('2010-01-01', $timezone); |
| 104 | 104 | $dateTime1->time = new \DateTime('2010-01-01 11:11:11', $timezone); |
| 105 | - $dateTime1->datetime= new \DateTime('2010-01-01 11:11:11', $timezone); |
|
| 105 | + $dateTime1->datetime = new \DateTime('2010-01-01 11:11:11', $timezone); |
|
| 106 | 106 | |
| 107 | 107 | $dateTime2->date = new \DateTime('2010-02-02', $timezone); |
| 108 | 108 | $dateTime2->time = new \DateTime('2010-02-02 12:12:12', $timezone); |
| 109 | - $dateTime2->datetime= new \DateTime('2010-02-02 12:12:12', $timezone); |
|
| 109 | + $dateTime2->datetime = new \DateTime('2010-02-02 12:12:12', $timezone); |
|
| 110 | 110 | |
| 111 | 111 | $this->_em->persist($dateTime1); |
| 112 | 112 | $this->_em->persist($dateTime2); |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $userClone = $this->_em->merge($userClone); |
| 61 | 61 | |
| 62 | 62 | // Back in managed world I would expect to have my phonenumbers back but they aren't! |
| 63 | - // Remember I didn't touch (and probably didn't need) them at all while in detached mode. |
|
| 63 | + // Remember I didn't touch (and probably didn't need) them at all while in detached mode. |
|
| 64 | 64 | $this->assertEquals(4, count($userClone->getPhonenumbers()), 'Phonenumbers are not available anymore'); |
| 65 | 65 | |
| 66 | 66 | // This works fine as long as cmUser::groups doesn't cascade "merge" |
@@ -89,13 +89,13 @@ |
||
| 89 | 89 | $user->username = 'lukacho'; |
| 90 | 90 | $user->status = 'developer'; |
| 91 | 91 | |
| 92 | - foreach([1111,2222,3333,4444] as $number) { |
|
| 92 | + foreach ([1111, 2222, 3333, 4444] as $number) { |
|
| 93 | 93 | $phone = new CmsPhonenumber; |
| 94 | 94 | $phone->phonenumber = $number; |
| 95 | 95 | $user->addPhonenumber($phone); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - foreach(['Moshers', 'Headbangers'] as $groupName) { |
|
| 98 | + foreach (['Moshers', 'Headbangers'] as $groupName) { |
|
| 99 | 99 | $group = new CmsGroup; |
| 100 | 100 | $group->setName($groupName); |
| 101 | 101 | $user->addGroup($group); |