@@ -1078,7 +1078,7 @@ |
||
1078 | 1078 | $this->expectExceptionMessage("You have specified invalid cascade options for " . CMS\CmsUser::class . "::\$address: 'invalid'; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'"); |
1079 | 1079 | |
1080 | 1080 | $cm->mapManyToOne(['fieldName' => 'address', 'targetEntity' => 'UnknownClass', 'cascade' => ['invalid']]); |
1081 | - } |
|
1081 | + } |
|
1082 | 1082 | |
1083 | 1083 | /** |
1084 | 1084 | * @group DDC-964 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | use Doctrine\Tests\OrmTestCase; |
22 | 22 | use DoctrineGlobal_Article; |
23 | 23 | |
24 | -require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
24 | +require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
25 | 25 | |
26 | 26 | class ClassMetadataTest extends OrmTestCase |
27 | 27 | { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->assertEquals('phonenumbers', $oneOneMapping['fieldName']); |
72 | 72 | $this->assertEquals(CMS\CmsAddress::class, $oneOneMapping['targetEntity']); |
73 | 73 | $this->assertTrue($cm->isReadOnly); |
74 | - $this->assertEquals(['dql' => ['name'=>'dql','query'=>'foo','dql'=>'foo']], $cm->namedQueries); |
|
74 | + $this->assertEquals(['dql' => ['name'=>'dql', 'query'=>'foo', 'dql'=>'foo']], $cm->namedQueries); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | public function testFieldIsNullable() |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | $cm = new ClassMetadata(CMS\CmsUser::class); |
206 | 206 | $cm->initializeReflection(new RuntimeReflectionService()); |
207 | - $cm->isIdentifierComposite = true; |
|
207 | + $cm->isIdentifierComposite = true; |
|
208 | 208 | |
209 | 209 | $this->expectException(\Doctrine\ORM\Mapping\MappingException::class); |
210 | 210 | $cm->getSingleIdentifierFieldName(); |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | |
397 | 397 | $this->assertEquals('CMS_ADDRESS_CMS_USER', $manyToManyMetadata->associationMappings['user']['joinTable']['name']); |
398 | 398 | |
399 | - $this->assertEquals(['CMS_ADDRESS_ID','CMS_USER_ID'], $manyToManyMetadata->associationMappings['user']['joinTableColumns']); |
|
399 | + $this->assertEquals(['CMS_ADDRESS_ID', 'CMS_USER_ID'], $manyToManyMetadata->associationMappings['user']['joinTableColumns']); |
|
400 | 400 | $this->assertEquals(['CMS_ADDRESS_ID'=>'ID'], $manyToManyMetadata->associationMappings['user']['relationToSourceKeyColumns']); |
401 | 401 | $this->assertEquals(['CMS_USER_ID'=>'ID'], $manyToManyMetadata->associationMappings['user']['relationToTargetKeyColumns']); |
402 | 402 | |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | $cm->initializeReflection(new RuntimeReflectionService()); |
437 | 437 | |
438 | 438 | $this->expectException(MappingException::class); |
439 | - $this->expectExceptionMessage("No mapping found for field 'foo' on class '" . CMS\CmsUser::class . "'."); |
|
439 | + $this->expectExceptionMessage("No mapping found for field 'foo' on class '".CMS\CmsUser::class."'."); |
|
440 | 440 | |
441 | 441 | $cm->getFieldMapping('foo'); |
442 | 442 | } |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | public function testEmptyFieldNameThrowsException() |
547 | 547 | { |
548 | 548 | $this->expectException(MappingException::class); |
549 | - $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'."); |
|
549 | + $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'."); |
|
550 | 550 | |
551 | 551 | $cm = new ClassMetadata(CMS\CmsUser::class); |
552 | 552 | $cm->initializeReflection(new RuntimeReflectionService()); |
@@ -701,12 +701,12 @@ discard block |
||
701 | 701 | $mapping = $cm->getSqlResultSetMapping('find-all'); |
702 | 702 | |
703 | 703 | $this->assertEquals(CMS\CmsUser::class, $mapping['entities'][0]['entityClass']); |
704 | - $this->assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
705 | - $this->assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
704 | + $this->assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
705 | + $this->assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
706 | 706 | |
707 | 707 | $this->assertEquals(CMS\CmsEmail::class, $mapping['entities'][1]['entityClass']); |
708 | - $this->assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
709 | - $this->assertEquals(['name'=>'email','column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
708 | + $this->assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
709 | + $this->assertEquals(['name'=>'email', 'column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
710 | 710 | |
711 | 711 | $this->assertEquals('scalarColumn', $mapping['columns'][0]['name']); |
712 | 712 | } |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | $cm->addLifecycleCallback('notfound', 'postLoad'); |
922 | 922 | |
923 | 923 | $this->expectException(MappingException::class); |
924 | - $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no method 'notfound' to be registered as lifecycle callback."); |
|
924 | + $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no method 'notfound' to be registered as lifecycle callback."); |
|
925 | 925 | |
926 | 926 | $cm->validateLifecycleCallbacks(new RuntimeReflectionService()); |
927 | 927 | } |
@@ -936,7 +936,7 @@ discard block |
||
936 | 936 | $cm->mapManyToOne(['fieldName' => 'address', 'targetEntity' => 'UnknownClass']); |
937 | 937 | |
938 | 938 | $this->expectException(MappingException::class); |
939 | - $this->expectExceptionMessage("The target-entity Doctrine\\Tests\\Models\\CMS\\UnknownClass cannot be found in '" . CMS\CmsUser::class . "#address'."); |
|
939 | + $this->expectExceptionMessage("The target-entity Doctrine\\Tests\\Models\\CMS\\UnknownClass cannot be found in '".CMS\CmsUser::class."#address'."); |
|
940 | 940 | |
941 | 941 | $cm->validateAssociations(); |
942 | 942 | } |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | $cm->initializeReflection(new RuntimeReflectionService()); |
1076 | 1076 | |
1077 | 1077 | $this->expectException(MappingException::class); |
1078 | - $this->expectExceptionMessage("You have specified invalid cascade options for " . CMS\CmsUser::class . "::\$address: 'invalid'; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'"); |
|
1078 | + $this->expectExceptionMessage("You have specified invalid cascade options for ".CMS\CmsUser::class."::\$address: 'invalid'; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'"); |
|
1079 | 1079 | |
1080 | 1080 | $cm->mapManyToOne(['fieldName' => 'address', 'targetEntity' => 'UnknownClass', 'cascade' => ['invalid']]); |
1081 | 1081 | } |
@@ -1320,7 +1320,7 @@ discard block |
||
1320 | 1320 | */ |
1321 | 1321 | public function propertyToColumnName($propertyName, $className = null) |
1322 | 1322 | { |
1323 | - return strtolower($this->classToTableName($className)) . '_' . $propertyName; |
|
1323 | + return strtolower($this->classToTableName($className)).'_'.$propertyName; |
|
1324 | 1324 | } |
1325 | 1325 | } |
1326 | 1326 |
@@ -56,14 +56,14 @@ |
||
56 | 56 | |
57 | 57 | $start = microtime(true); |
58 | 58 | $contracts = $this->_em->getRepository(CompanyContract::class)->findAll(); |
59 | - echo "99 CompanyContract: " . number_format(microtime(true) - $start, 6) . "\n"; |
|
59 | + echo "99 CompanyContract: ".number_format(microtime(true) - $start, 6)."\n"; |
|
60 | 60 | $this->assertEquals(99, count($contracts)); |
61 | 61 | |
62 | 62 | $this->_em->clear(); |
63 | 63 | |
64 | 64 | $start = microtime(true); |
65 | 65 | $contracts = $this->_em->getRepository(CompanyContract::class)->findAll(); |
66 | - echo "99 CompanyContract: " . number_format(microtime(true) - $start, 6) . "\n"; |
|
66 | + echo "99 CompanyContract: ".number_format(microtime(true) - $start, 6)."\n"; |
|
67 | 67 | $this->assertEquals(99, count($contracts)); |
68 | 68 | } |
69 | 69 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | $e = microtime(true); |
60 | 60 | |
61 | - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; |
|
61 | + echo __FUNCTION__." - ".($e - $s)." seconds".PHP_EOL; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | private function loadFixture() |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | foreach ($content as $selection) { |
155 | 155 | $field = $result[$selection->field]; |
156 | 156 | $choiceList = $selection->choiceList; |
157 | - $fieldSelection = new DDC2602FieldSelection(); |
|
157 | + $fieldSelection = new DDC2602FieldSelection(); |
|
158 | 158 | |
159 | 159 | $fieldSelection->field = $field; |
160 | - $fieldSelection->choiceList = $field->choiceList->filter(function ($choice) use ($choiceList) { |
|
160 | + $fieldSelection->choiceList = $field->choiceList->filter(function($choice) use ($choiceList) { |
|
161 | 161 | return in_array($choice->id, $choiceList); |
162 | 162 | }); |
163 | 163 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $s = microtime(true); |
80 | 80 | $result = $hydrator->hydrateAll($stmt, $rsm); |
81 | 81 | $e = microtime(true); |
82 | - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; |
|
82 | + echo __FUNCTION__." - ".($e - $s)." seconds".PHP_EOL; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $s = microtime(true); |
138 | 138 | $result = $hydrator->hydrateAll($stmt, $rsm); |
139 | 139 | $e = microtime(true); |
140 | - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; |
|
140 | + echo __FUNCTION__." - ".($e - $s)." seconds".PHP_EOL; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | 'u__status' => 'developer', |
200 | 200 | 'u__username' => 'jwage', |
201 | 201 | 'u__name' => 'Jonathan', |
202 | - 'sclr0' => 'JWAGE' . $i, |
|
202 | + 'sclr0' => 'JWAGE'.$i, |
|
203 | 203 | 'p__phonenumber' => '91' |
204 | 204 | ]; |
205 | 205 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $s = microtime(true); |
212 | 212 | $result = $hydrator->hydrateAll($stmt, $rsm); |
213 | 213 | $e = microtime(true); |
214 | - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; |
|
214 | + echo __FUNCTION__." - ".($e - $s)." seconds".PHP_EOL; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $s = microtime(true); |
268 | 268 | $result = $hydrator->hydrateAll($stmt, $rsm, [Query::HINT_FORCE_PARTIAL_LOAD => true]); |
269 | 269 | $e = microtime(true); |
270 | - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; |
|
270 | + echo __FUNCTION__." - ".($e - $s)." seconds".PHP_EOL; |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | /** |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $s = microtime(true); |
324 | 324 | $result = $hydrator->hydrateAll($stmt, $rsm); |
325 | 325 | $e = microtime(true); |
326 | - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; |
|
326 | + echo __FUNCTION__." - ".($e - $s)." seconds".PHP_EOL; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | /** |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | 'u__status' => 'developer', |
384 | 384 | 'u__username' => 'jwage', |
385 | 385 | 'u__name' => 'Jonathan', |
386 | - 'sclr0' => 'JWAGE' . $i, |
|
386 | + 'sclr0' => 'JWAGE'.$i, |
|
387 | 387 | 'p__phonenumber' => '91' |
388 | 388 | ]; |
389 | 389 | } |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $s = microtime(true); |
396 | 396 | $result = $hydrator->hydrateAll($stmt, $rsm, [Query::HINT_FORCE_PARTIAL_LOAD => true]); |
397 | 397 | $e = microtime(true); |
398 | - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; |
|
398 | + echo __FUNCTION__." - ".($e - $s)." seconds".PHP_EOL; |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | /** |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | 'u__status' => 'developer', |
438 | 438 | 'u__username' => 'jwage', |
439 | 439 | 'u__name' => 'Jonathan', |
440 | - 'sclr0' => 'JWAGE' . $i, |
|
440 | + 'sclr0' => 'JWAGE'.$i, |
|
441 | 441 | 'p__phonenumber' => '91', |
442 | 442 | 'a__id' => $i |
443 | 443 | ]; |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | $s = microtime(true); |
451 | 451 | $result = $hydrator->hydrateAll($stmt, $rsm); |
452 | 452 | $e = microtime(true); |
453 | - echo __FUNCTION__ . " - " . ($e - $s) . " seconds" . PHP_EOL; |
|
453 | + echo __FUNCTION__." - ".($e - $s)." seconds".PHP_EOL; |
|
454 | 454 | } |
455 | 455 | } |
456 | 456 |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | $n = 100; |
25 | 25 | |
26 | 26 | $users = []; |
27 | - for ($i=1; $i<=$n; ++$i) { |
|
27 | + for ($i = 1; $i <= $n; ++$i) { |
|
28 | 28 | $user = new CmsUser; |
29 | 29 | $user->status = 'user'; |
30 | - $user->username = 'user' . $i; |
|
31 | - $user->name = 'Mr.Smith-' . $i; |
|
30 | + $user->username = 'user'.$i; |
|
31 | + $user->name = 'Mr.Smith-'.$i; |
|
32 | 32 | $this->_em->persist($user); |
33 | 33 | $users[] = $user; |
34 | 34 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | foreach ($users AS $user) { |
39 | 39 | $user->status = 'other'; |
40 | - $user->username = $user->username . '++'; |
|
40 | + $user->username = $user->username.'++'; |
|
41 | 41 | $user->name = str_replace('Mr.', 'Mrs.', $user->name); |
42 | 42 | } |
43 | 43 | |
@@ -45,6 +45,6 @@ discard block |
||
45 | 45 | $this->_em->flush(); |
46 | 46 | $e = microtime(true); |
47 | 47 | |
48 | - echo ' Compute ChangeSet '.$n.' objects in ' . ($e - $s) . ' seconds' . PHP_EOL; |
|
48 | + echo ' Compute ChangeSet '.$n.' objects in '.($e - $s).' seconds'.PHP_EOL; |
|
49 | 49 | } |
50 | 50 | } |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | //echo "Memory usage before: " . (memory_get_usage() / 1024) . " KB" . PHP_EOL; |
34 | 34 | |
35 | 35 | $batchSize = 20; |
36 | - for ($i=1; $i<=10000; ++$i) { |
|
36 | + for ($i = 1; $i <= 10000; ++$i) { |
|
37 | 37 | $user = new CmsUser; |
38 | 38 | $user->status = 'user'; |
39 | - $user->username = 'user' . $i; |
|
40 | - $user->name = 'Mr.Smith-' . $i; |
|
39 | + $user->username = 'user'.$i; |
|
40 | + $user->name = 'Mr.Smith-'.$i; |
|
41 | 41 | $this->_em->persist($user); |
42 | 42 | if (($i % $batchSize) == 0) { |
43 | 43 | $this->_em->flush(); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | $e = microtime(true); |
52 | 52 | |
53 | - echo ' Inserted 10000 objects in ' . ($e - $s) . ' seconds' . PHP_EOL; |
|
53 | + echo ' Inserted 10000 objects in '.($e - $s).' seconds'.PHP_EOL; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $user = $proxyFactory->getProxy($entityName, ['id' => $i]); |
43 | 43 | } |
44 | 44 | |
45 | - echo __FUNCTION__ . " - " . (microtime(true) - $start) . " seconds with " . $entityName . PHP_EOL; |
|
45 | + echo __FUNCTION__." - ".(microtime(true) - $start)." seconds with ".$entityName.PHP_EOL; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | $this->setMaxRunningTime(5); |
60 | 60 | $start = microtime(true); |
61 | 61 | |
62 | - for ($i = 0; $i < 100000; $i += 1) { |
|
62 | + for ($i = 0; $i < 100000; $i += 1) { |
|
63 | 63 | $user->__setInitialized(false); |
64 | 64 | $user->__setInitializer($initializer); |
65 | 65 | $user->__load(); |
66 | 66 | $user->__load(); |
67 | 67 | } |
68 | 68 | |
69 | - echo __FUNCTION__ . " - " . (microtime(true) - $start) . " seconds with " . $entityName . PHP_EOL; |
|
69 | + echo __FUNCTION__." - ".(microtime(true) - $start)." seconds with ".$entityName.PHP_EOL; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 |
@@ -24,18 +24,18 @@ |
||
24 | 24 | public $avatar; |
25 | 25 | |
26 | 26 | public function getId() { |
27 | - return $this->id; |
|
27 | + return $this->id; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function getUsername() { |
31 | - return $this->username; |
|
31 | + return $this->username; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function getAvatar() { |
35 | - return $this->avatar; |
|
35 | + return $this->avatar; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function setAvatar(ForumAvatar $avatar) { |
39 | - $this->avatar = $avatar; |
|
39 | + $this->avatar = $avatar; |
|
40 | 40 | } |
41 | 41 | } |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | { |
84 | 84 | $metadata->mapField( |
85 | 85 | [ |
86 | - 'id' => true, |
|
87 | - 'fieldName' => 'id', |
|
88 | - 'type' => 'integer', |
|
89 | - 'columnName' => 'user_id', |
|
90 | - 'length' => 150, |
|
86 | + 'id' => true, |
|
87 | + 'fieldName' => 'id', |
|
88 | + 'type' => 'integer', |
|
89 | + 'columnName' => 'user_id', |
|
90 | + 'length' => 150, |
|
91 | 91 | ] |
92 | 92 | ); |
93 | 93 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | |
105 | 105 | $metadata->mapManyToMany( |
106 | 106 | [ |
107 | - 'fieldName' => 'groups', |
|
108 | - 'targetEntity' => 'DDC3579Group' |
|
107 | + 'fieldName' => 'groups', |
|
108 | + 'targetEntity' => 'DDC3579Group' |
|
109 | 109 | ] |
110 | 110 | ); |
111 | 111 |