Failed Conditions
Pull Request — master (#6593)
by Thomas
16:12
created
Hydration/MixedQueryFetchJoinFullObjectHydrationPerformanceBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
                 'u__status'      => 'developer',
52 52
                 'u__username'    => 'jwage',
53 53
                 'u__name'        => 'Jonathan',
54
-                'sclr0'          => 'JWAGE' . $i,
54
+                'sclr0'          => 'JWAGE'.$i,
55 55
                 'p__phonenumber' => '91',
56 56
                 'a__id'          => $i
57 57
             ];
Please login to merge, or discard this patch.
tests/Doctrine/Performance/Hydration/SimpleHydrationBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
             $user = new CMS\CmsUser();
40 40
 
41 41
             $user->status   = 'developer';
42
-            $user->username = 'jwage' . $i;
42
+            $user->username = 'jwage'.$i;
43 43
             $user->name     = 'Jonathan';
44 44
 
45 45
             $this->entityManager->persist($user);
Please login to merge, or discard this patch.
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.
lib/Doctrine/ORM/ORMInvalidArgumentException.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     static public function scheduleInsertForManagedEntity($entity)
36 36
     {
37
-        return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion.");
37
+        return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion.");
38 38
     }
39 39
 
40 40
     /**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     static public function scheduleInsertForRemovedEntity($entity)
46 46
     {
47
-        return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion.");
47
+        return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion.");
48 48
     }
49 49
 
50 50
     /**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     static public function scheduleInsertTwice($entity)
56 56
     {
57
-        return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice.");
57
+        return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice.");
58 58
     }
59 59
 
60 60
     /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     static public function entityWithoutIdentity($className, $entity)
67 67
     {
68 68
         return new self(
69
-            "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " .
69
+            "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ".
70 70
             "id values set. It cannot be added to the identity map."
71 71
         );
72 72
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     static public function readOnlyRequiresManagedEntity($entity)
80 80
     {
81
-        return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not");
81
+        return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not");
82 82
     }
83 83
 
84 84
     /**
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
     static public function newEntityFoundThroughRelationship(array $assoc, $entry)
91 91
     {
92 92
         return new self("A new entity was found through the relationship '"
93
-            . $assoc['sourceEntity'] . "#" . $assoc['fieldName'] . "' that was not"
94
-            . " configured to cascade persist operations for entity: " . self::objToStr($entry) . "."
93
+            . $assoc['sourceEntity']."#".$assoc['fieldName']."' that was not"
94
+            . " configured to cascade persist operations for entity: ".self::objToStr($entry)."."
95 95
             . " To solve this issue: Either explicitly call EntityManager#persist()"
96 96
             . " on this unknown entity or configure cascade persist"
97 97
             . " this association in the mapping for example @ManyToOne(..,cascade={\"persist\"})."
98
-            . (method_exists($entry, '__toString') ? "": " If you cannot find out which entity causes the problem"
99
-            . " implement '" . $assoc['targetEntity'] . "#__toString()' to get a clue."));
98
+            . (method_exists($entry, '__toString') ? "" : " If you cannot find out which entity causes the problem"
99
+            . " implement '".$assoc['targetEntity']."#__toString()' to get a clue."));
100 100
     }
101 101
 
102 102
     /**
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
      */
108 108
     static public function detachedEntityFoundThroughRelationship(array $assoc, $entry)
109 109
     {
110
-        return new self("A detached entity of type " . $assoc['targetEntity'] . " (" . self::objToStr($entry) . ") "
111
-            . " was found through the relationship '" . $assoc['sourceEntity'] . "#" . $assoc['fieldName'] . "' "
110
+        return new self("A detached entity of type ".$assoc['targetEntity']." (".self::objToStr($entry).") "
111
+            . " was found through the relationship '".$assoc['sourceEntity']."#".$assoc['fieldName']."' "
112 112
             . "during cascading a persist operation.");
113 113
     }
114 114
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     static public function entityNotManaged($entity)
121 121
     {
122
-        return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " .
122
+        return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ".
123 123
             "from the database or registered as new through EntityManager#persist");
124 124
     }
125 125
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     static public function entityHasNoIdentity($entity, $operation)
133 133
     {
134
-        return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity));
134
+        return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity));
135 135
     }
136 136
 
137 137
     /**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     static public function entityIsRemoved($entity, $operation)
144 144
     {
145
-        return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity));
145
+        return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity));
146 146
     }
147 147
 
148 148
     /**
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     static public function detachedEntityCannot($entity, $operation)
155 155
     {
156
-        return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation);
156
+        return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation);
157 157
     }
158 158
 
159 159
     /**
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public static function invalidObject($context, $given, $parameterIndex = 1)
167 167
     {
168
-        return new self($context . ' expects parameter ' . $parameterIndex .
169
-            ' to be an entity object, '. gettype($given) . ' given.');
168
+        return new self($context.' expects parameter '.$parameterIndex.
169
+            ' to be an entity object, '.gettype($given).' given.');
170 170
     }
171 171
 
172 172
     /**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      */
175 175
     public static function invalidCompositeIdentifier()
176 176
     {
177
-        return new self("Binding an entity with a composite primary key to a query is not supported. " .
177
+        return new self("Binding an entity with a composite primary key to a query is not supported. ".
178 178
             "You should split the parameter into the explicit fields and bind them separately.");
179 179
     }
180 180
 
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
             $array['entityListeners'][$entityListener['class']][$event] = [$entityListener['method']];
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): string
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.