Passed
Pull Request — master (#6887)
by Grégoire
12:33
created
tests/Doctrine/Performance/ChangeSet/UnitOfWorkComputeChangesBench.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
             $user           = new CmsUser;
33 33
             $user->id       = $i;
34 34
             $user->status   = 'user';
35
-            $user->username = 'user' . $i;
36
-            $user->name     = 'Mr.Smith-' . $i;
35
+            $user->username = 'user'.$i;
36
+            $user->name     = 'Mr.Smith-'.$i;
37 37
             $this->users[]  = $user;
38 38
 
39 39
             $this->unitOfWork->registerManaged(
Please login to merge, or discard this patch.
tests/Doctrine/Performance/EntityManagerFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
     {
16 16
         $config = new Configuration();
17 17
 
18
-        $config->setProxyDir(__DIR__ . '/../Tests/Proxies');
18
+        $config->setProxyDir(__DIR__.'/../Tests/Proxies');
19 19
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
20 20
         $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL);
21 21
         $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([
22
-            realpath(__DIR__ . '/Models/Cache'),
23
-            realpath(__DIR__ . '/Models/GeoNames')
22
+            realpath(__DIR__.'/Models/Cache'),
23
+            realpath(__DIR__.'/Models/GeoNames')
24 24
         ], true));
25 25
 
26 26
         $entityManager = EntityManager::create(
Please login to merge, or discard this patch.
Performance/Hydration/MixedQueryFetchJoinArrayHydrationPerformanceBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
                 'u__status'      => 'developer',
67 67
                 'u__username'    => 'jwage',
68 68
                 'u__name'        => 'Jonathan',
69
-                'sclr0'          => 'JWAGE' . $i,
69
+                'sclr0'          => 'JWAGE'.$i,
70 70
                 'p__phonenumber' => '91'
71 71
             ];
72 72
         }
Please login to merge, or discard this patch.
Tests/ORM/Tools/Export/php/Doctrine.Tests.ORM.Tools.Export.User.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE);
11 11
 $metadata->setPrimaryTable(
12 12
     [
13
-   'name' => 'cms_users',
14
-   'options' => ['engine' => 'MyISAM', 'foo' => ['bar' => 'baz']],
13
+    'name' => 'cms_users',
14
+    'options' => ['engine' => 'MyISAM', 'foo' => ['bar' => 'baz']],
15 15
     ]
16 16
 );
17 17
 $metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT);
@@ -20,35 +20,35 @@  discard block
 block discarded – undo
20 20
 $metadata->addLifecycleCallback('doStuffOnPostPersist', Events::postPersist);
21 21
 $metadata->mapField(
22 22
     [
23
-   'id' => true,
24
-   'fieldName' => 'id',
25
-   'type' => 'integer',
26
-   'columnName' => 'id',
23
+    'id' => true,
24
+    'fieldName' => 'id',
25
+    'type' => 'integer',
26
+    'columnName' => 'id',
27 27
     ]
28 28
 );
29 29
 $metadata->mapField(
30 30
     [
31
-   'fieldName' => 'name',
32
-   'type' => 'string',
33
-   'length' => 50,
34
-   'unique' => true,
35
-   'nullable' => true,
36
-   'columnName' => 'name',
31
+    'fieldName' => 'name',
32
+    'type' => 'string',
33
+    'length' => 50,
34
+    'unique' => true,
35
+    'nullable' => true,
36
+    'columnName' => 'name',
37 37
     ]
38 38
 );
39 39
 $metadata->mapField(
40 40
     [
41
-   'fieldName' => 'email',
42
-   'type' => 'string',
43
-   'columnName' => 'user_email',
44
-   'columnDefinition' => 'CHAR(32) NOT NULL',
41
+    'fieldName' => 'email',
42
+    'type' => 'string',
43
+    'columnName' => 'user_email',
44
+    'columnDefinition' => 'CHAR(32) NOT NULL',
45 45
     ]
46 46
 );
47 47
 $metadata->mapField(
48 48
     [
49
-   'fieldName' => 'age',
50
-   'type' => 'integer',
51
-   'options' => ["unsigned"=>true],
49
+    'fieldName' => 'age',
50
+    'type' => 'integer',
51
+    'options' => ["unsigned"=>true],
52 52
     ]
53 53
 );
54 54
 $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);
@@ -60,25 +60,25 @@  discard block
 block discarded – undo
60 60
 );
61 61
 $metadata->mapOneToOne(
62 62
     [
63
-   'fieldName' => 'address',
64
-   'targetEntity' => Export\Address::class,
65
-   'inversedBy' => 'user',
66
-   'cascade' =>
67
-   [
68
-   0 => 'persist',
69
-   ],
70
-   'mappedBy' => NULL,
71
-   'joinColumns' =>
72
-   [
73
-   0 =>
74
-   [
63
+    'fieldName' => 'address',
64
+    'targetEntity' => Export\Address::class,
65
+    'inversedBy' => 'user',
66
+    'cascade' =>
67
+    [
68
+    0 => 'persist',
69
+    ],
70
+    'mappedBy' => NULL,
71
+    'joinColumns' =>
72
+    [
73
+    0 =>
74
+    [
75 75
     'name' => 'address_id',
76 76
     'referencedColumnName' => 'id',
77 77
     'onDelete' => 'CASCADE',
78
-   ],
79
-   ],
80
-   'orphanRemoval' => true,
81
-   'fetch' => ClassMetadataInfo::FETCH_EAGER,
78
+    ],
79
+    ],
80
+    'orphanRemoval' => true,
81
+    'fetch' => ClassMetadataInfo::FETCH_EAGER,
82 82
     ]
83 83
 );
84 84
 $metadata->mapOneToOne(
@@ -97,41 +97,41 @@  discard block
 block discarded – undo
97 97
 );
98 98
 $metadata->mapOneToMany(
99 99
     [
100
-   'fieldName' => 'phonenumbers',
101
-   'targetEntity' => Export\Phonenumber::class,
102
-   'cascade' =>
103
-   [
104
-   1 => 'persist',
105
-   2 => 'merge',
106
-   ],
107
-   'mappedBy' => 'user',
108
-   'orphanRemoval' => true,
109
-   'fetch' => ClassMetadataInfo::FETCH_LAZY,
110
-   'orderBy' =>
111
-   [
112
-   'number' => 'ASC',
113
-   ],
100
+    'fieldName' => 'phonenumbers',
101
+    'targetEntity' => Export\Phonenumber::class,
102
+    'cascade' =>
103
+    [
104
+    1 => 'persist',
105
+    2 => 'merge',
106
+    ],
107
+    'mappedBy' => 'user',
108
+    'orphanRemoval' => true,
109
+    'fetch' => ClassMetadataInfo::FETCH_LAZY,
110
+    'orderBy' =>
111
+    [
112
+    'number' => 'ASC',
113
+    ],
114 114
     ]
115 115
 );
116 116
 $metadata->mapManyToMany(
117 117
     [
118
-   'fieldName' => 'groups',
119
-   'targetEntity' => Export\Group::class,
120
-   'fetch' => ClassMetadataInfo::FETCH_EXTRA_LAZY,
121
-   'cascade' =>
122
-   [
123
-   0 => 'remove',
124
-   1 => 'persist',
125
-   2 => 'refresh',
126
-   3 => 'merge',
127
-   4 => 'detach',
128
-   ],
129
-   'mappedBy' => NULL,
130
-   'joinTable' =>
131
-   [
132
-   'name' => 'cms_users_groups',
133
-   'joinColumns' =>
134
-   [
118
+    'fieldName' => 'groups',
119
+    'targetEntity' => Export\Group::class,
120
+    'fetch' => ClassMetadataInfo::FETCH_EXTRA_LAZY,
121
+    'cascade' =>
122
+    [
123
+    0 => 'remove',
124
+    1 => 'persist',
125
+    2 => 'refresh',
126
+    3 => 'merge',
127
+    4 => 'detach',
128
+    ],
129
+    'mappedBy' => NULL,
130
+    'joinTable' =>
131
+    [
132
+    'name' => 'cms_users_groups',
133
+    'joinColumns' =>
134
+    [
135 135
     0 =>
136 136
     [
137 137
     'name' => 'user_id',
@@ -139,18 +139,18 @@  discard block
 block discarded – undo
139 139
     'unique' => false,
140 140
     'nullable' => false,
141 141
     ],
142
-   ],
143
-   'inverseJoinColumns' =>
144
-   [
142
+    ],
143
+    'inverseJoinColumns' =>
144
+    [
145 145
     0 =>
146 146
     [
147 147
     'name' => 'group_id',
148 148
     'referencedColumnName' => 'id',
149 149
     'columnDefinition' => 'INT NULL',
150 150
     ],
151
-   ],
152
-   ],
153
-   'orderBy' => NULL,
151
+    ],
152
+    ],
153
+    'orderBy' => NULL,
154 154
     ]
155 155
 );
156 156
 $metadata->addEntityListener(Events::prePersist, UserListener::class, 'customPrePersist');
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2602Test.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         $eventManager->addEventListener([Events::postLoad], new DDC2602PostLoadListener());
49 49
 
50 50
         $result = $this->_em->createQuery('SELECT u, b FROM Doctrine\Tests\ORM\Functional\Ticket\DDC2602User u JOIN u.biography b')
51
-                             ->getResult();
51
+                                ->getResult();
52 52
 
53 53
         self::assertCount(2, $result);
54 54
         self::assertCount(2, $result[0]->biography->fieldList);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -149,10 +149,10 @@
 block discarded – undo
149 149
         foreach ($content as $selection) {
150 150
             $field      = $result[$selection->field];
151 151
             $choiceList = $selection->choiceList;
152
-            $fieldSelection     = new DDC2602FieldSelection();
152
+            $fieldSelection = new DDC2602FieldSelection();
153 153
 
154 154
             $fieldSelection->field      = $field;
155
-            $fieldSelection->choiceList = $field->choiceList->filter(function ($choice) use ($choiceList) {
155
+            $fieldSelection->choiceList = $field->choiceList->filter(function($choice) use ($choiceList) {
156 156
                 return in_array($choice->id, $choiceList);
157 157
             });
158 158
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/PersistentCollectionTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             ->expects(self::once())
169 169
             ->method('loadCollection')
170 170
             ->with($this->collection)
171
-            ->willReturnCallback(function (PersistentCollection $persistentCollection) use ($persistedElement) : void {
171
+            ->willReturnCallback(function(PersistentCollection $persistentCollection) use ($persistedElement) : void {
172 172
                 $persistentCollection->unwrap()->add($persistedElement);
173 173
             });
174 174
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             ->expects(self::once())
206 206
             ->method('loadCollection')
207 207
             ->with($this->collection)
208
-            ->willReturnCallback(function (PersistentCollection $persistentCollection) use (
208
+            ->willReturnCallback(function(PersistentCollection $persistentCollection) use (
209 209
                 $persistedElement,
210 210
                 $newElementThatIsAlsoPersisted
211 211
             ) : void {
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
             ->expects(self::once())
248 248
             ->method('loadCollection')
249 249
             ->with($this->collection)
250
-            ->willReturnCallback(function (PersistentCollection $persistentCollection) use (
250
+            ->willReturnCallback(function(PersistentCollection $persistentCollection) use (
251 251
                 $persistedElement,
252 252
                 $newElementThatIsAlsoPersisted
253 253
             ) : void {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -253,7 +253,7 @@
 block discarded – undo
253 253
     private function processEntityListenerConfig(array $array, array $entityListenerConfig, string $event) : array
254 254
     {
255 255
         foreach ($entityListenerConfig as $entityListener) {
256
-            if (! isset($array['entityListeners'][$entityListener['class']])) {
256
+            if ( ! isset($array['entityListeners'][$entityListener['class']])) {
257 257
                 $array['entityListeners'][$entityListener['class']] = [];
258 258
             }
259 259
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -51,27 +51,27 @@  discard block
 block discarded – undo
51 51
         }
52 52
 
53 53
         if ($metadata->inheritanceType) {
54
-            $lines[] = '$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_' . $this->_getInheritanceTypeString($metadata->inheritanceType) . ');';
54
+            $lines[] = '$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_'.$this->_getInheritanceTypeString($metadata->inheritanceType).');';
55 55
         }
56 56
 
57 57
         if ($metadata->customRepositoryClassName) {
58
-            $lines[] = "\$metadata->customRepositoryClassName = '" . $metadata->customRepositoryClassName . "';";
58
+            $lines[] = "\$metadata->customRepositoryClassName = '".$metadata->customRepositoryClassName."';";
59 59
         }
60 60
 
61 61
         if ($metadata->table) {
62
-            $lines[] = '$metadata->setPrimaryTable(' . $this->_varExport($metadata->table) . ');';
62
+            $lines[] = '$metadata->setPrimaryTable('.$this->_varExport($metadata->table).');';
63 63
         }
64 64
 
65 65
         if ($metadata->discriminatorColumn) {
66
-            $lines[] = '$metadata->setDiscriminatorColumn(' . $this->_varExport($metadata->discriminatorColumn) . ');';
66
+            $lines[] = '$metadata->setDiscriminatorColumn('.$this->_varExport($metadata->discriminatorColumn).');';
67 67
         }
68 68
 
69 69
         if ($metadata->discriminatorMap) {
70
-            $lines[] = '$metadata->setDiscriminatorMap(' . $this->_varExport($metadata->discriminatorMap) . ');';
70
+            $lines[] = '$metadata->setDiscriminatorMap('.$this->_varExport($metadata->discriminatorMap).');';
71 71
         }
72 72
 
73 73
         if ($metadata->changeTrackingPolicy) {
74
-            $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_' . $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy) . ');';
74
+            $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_'.$this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy).');';
75 75
         }
76 76
 
77 77
         if ($metadata->lifecycleCallbacks) {
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
         $lines = array_merge($lines, $this->processEntityListeners($metadata));
86 86
 
87 87
         foreach ($metadata->fieldMappings as $fieldMapping) {
88
-            $lines[] = '$metadata->mapField(' . $this->_varExport($fieldMapping) . ');';
88
+            $lines[] = '$metadata->mapField('.$this->_varExport($fieldMapping).');';
89 89
         }
90 90
 
91 91
         if ( ! $metadata->isIdentifierComposite && $generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
92
-            $lines[] = '$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_' . $generatorType . ');';
92
+            $lines[] = '$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_'.$generatorType.');';
93 93
         }
94 94
 
95 95
         foreach ($metadata->associationMappings as $associationMapping) {
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                 $associationMappingArray = array_merge($associationMappingArray, $manyToManyMappingArray);
156 156
             }
157 157
 
158
-            $lines[] = '$metadata->' . $method . '(' . $this->_varExport($associationMappingArray) . ');';
158
+            $lines[] = '$metadata->'.$method.'('.$this->_varExport($associationMappingArray).');';
159 159
         }
160 160
 
161 161
         return implode("\n", $lines);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     protected function _varExport($var)
170 170
     {
171 171
         $export = var_export($var, true);
172
-        $export = str_replace("\n", PHP_EOL . str_repeat(' ', 8), $export);
172
+        $export = str_replace("\n", PHP_EOL.str_repeat(' ', 8), $export);
173 173
         $export = str_replace('  ', ' ', $export);
174 174
         $export = str_replace('array (', 'array(', $export);
175 175
         $export = str_replace('array( ', 'array(', $export);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function exportClassMetadata(ClassMetadataInfo $metadata)
43 43
     {
44
-        $xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping ' .
45
-            'xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" ' .
46
-            'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' .
44
+        $xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping '.
45
+            'xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" '.
46
+            'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '.
47 47
             'xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd" />');
48 48
 
49 49
         if ($metadata->isMappedSuperclass) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
         $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy);
100 100
 
101
-        if ( $trackingPolicy != 'DEFERRED_IMPLICIT') {
101
+        if ($trackingPolicy != 'DEFERRED_IMPLICIT') {
102 102
             $root->addChild('change-tracking-policy', $trackingPolicy);
103 103
         }
104 104
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
             }
298 298
 
299 299
             if (count($cascade) === 5) {
300
-                $cascade  = ['cascade-all'];
300
+                $cascade = ['cascade-all'];
301 301
             }
302 302
 
303 303
             if ($cascade) {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
             }
380 380
         }
381 381
 
382
-        if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) {
382
+        if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks) > 0) {
383 383
             $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks');
384 384
 
385 385
             foreach ($metadata->lifecycleCallbacks as $name => $methods) {
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
     {
431 431
         $sequenceDefinition = $metadata->sequenceGeneratorDefinition;
432 432
 
433
-        if (! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
433
+        if ( ! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
434 434
             return;
435 435
         }
436 436
 
Please login to merge, or discard this patch.