Passed
Pull Request — master (#7543)
by
unknown
32:50
created
lib/Doctrine/ORM/ORMInvalidArgumentException.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public static function scheduleInsertForManagedEntity($entity)
32 32
     {
33
-        return new self('A managed+dirty entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.');
33
+        return new self('A managed+dirty entity '.self::objToStr($entity).' can not be scheduled for insertion.');
34 34
     }
35 35
 
36 36
     /**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public static function scheduleInsertForRemovedEntity($entity)
42 42
     {
43
-        return new self('Removed entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.');
43
+        return new self('Removed entity '.self::objToStr($entity).' can not be scheduled for insertion.');
44 44
     }
45 45
 
46 46
     /**
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public static function scheduleInsertTwice($entity)
52 52
     {
53
-        return new self('Entity ' . self::objToStr($entity) . ' can not be scheduled for insertion twice.');
53
+        return new self('Entity '.self::objToStr($entity).' can not be scheduled for insertion twice.');
54 54
     }
55 55
 
56 56
     /**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public static function entityWithoutIdentity($className, $entity)
63 63
     {
64 64
         return new self(
65
-            "The given entity of type '" . $className . "' (" . self::objToStr($entity) . ') has no identity/no ' .
65
+            "The given entity of type '".$className."' (".self::objToStr($entity).') has no identity/no '.
66 66
             'id values set. It cannot be added to the identity map.'
67 67
         );
68 68
     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public static function readOnlyRequiresManagedEntity($entity)
76 76
     {
77
-        return new self('Only managed entities can be marked or checked as read only. But ' . self::objToStr($entity) . ' is not');
77
+        return new self('Only managed entities can be marked or checked as read only. But '.self::objToStr($entity).' is not');
78 78
     }
79 79
 
80 80
     /**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     public static function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations)
86 86
     {
87 87
         $errorMessages = array_map(
88
-            static function (array $newEntityWithAssociation) : string {
88
+            static function(array $newEntityWithAssociation) : string {
89 89
                 [$associationMetadata, $entity] = $newEntityWithAssociation;
90 90
 
91 91
                 return self::newEntityFoundThroughRelationshipMessage($associationMetadata, $entity);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public static function entityNotManaged($entity)
156 156
     {
157
-        return new self('Entity ' . self::objToStr($entity) . ' is not managed. An entity is managed if its fetched ' .
157
+        return new self('Entity '.self::objToStr($entity).' is not managed. An entity is managed if its fetched '.
158 158
             'from the database or registered as new through EntityManager#persist');
159 159
     }
160 160
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     public static function entityHasNoIdentity($entity, $operation)
168 168
     {
169
-        return new self('Entity has no identity, therefore ' . $operation . ' cannot be performed. ' . self::objToStr($entity));
169
+        return new self('Entity has no identity, therefore '.$operation.' cannot be performed. '.self::objToStr($entity));
170 170
     }
171 171
 
172 172
     /**
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public static function entityIsRemoved($entity, $operation)
179 179
     {
180
-        return new self('Entity is removed, therefore ' . $operation . ' cannot be performed. ' . self::objToStr($entity));
180
+        return new self('Entity is removed, therefore '.$operation.' cannot be performed. '.self::objToStr($entity));
181 181
     }
182 182
 
183 183
     /**
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      */
189 189
     public static function detachedEntityCannot($entity, $operation)
190 190
     {
191
-        return new self('Detached entity ' . self::objToStr($entity) . ' cannot be ' . $operation);
191
+        return new self('Detached entity '.self::objToStr($entity).' cannot be '.$operation);
192 192
     }
193 193
 
194 194
     /**
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public static function invalidObject($context, $given, $parameterIndex = 1)
202 202
     {
203
-        return new self($context . ' expects parameter ' . $parameterIndex .
204
-            ' to be an entity object, ' . gettype($given) . ' given.');
203
+        return new self($context.' expects parameter '.$parameterIndex.
204
+            ' to be an entity object, '.gettype($given).' given.');
205 205
     }
206 206
 
207 207
     /**
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      */
210 210
     public static function invalidCompositeIdentifier()
211 211
     {
212
-        return new self('Binding an entity with a composite primary key to a query is not supported. ' .
212
+        return new self('Binding an entity with a composite primary key to a query is not supported. '.
213 213
             'You should split the parameter into the explicit fields and bind them separately.');
214 214
     }
215 215
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
      */
219 219
     public static function invalidIdentifierBindingEntity()
220 220
     {
221
-        return new self('Binding entities to query parameters only allowed for entities that have an identifier. ' .
221
+        return new self('Binding entities to query parameters only allowed for entities that have an identifier. '.
222 222
             'Have you persisted the entity to the database?');
223 223
     }
224 224
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      */
248 248
     private static function objToStr($obj) : string
249 249
     {
250
-        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj);
250
+        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj);
251 251
     }
252 252
 
253 253
     /**
@@ -256,15 +256,15 @@  discard block
 block discarded – undo
256 256
     private static function newEntityFoundThroughRelationshipMessage(AssociationMetadata $association, $entity) : string
257 257
     {
258 258
         return 'A new entity was found through the relationship \''
259
-            . $association->getSourceEntity() . '#' . $association->getName() . '\' that was not'
260
-            . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.'
259
+            . $association->getSourceEntity().'#'.$association->getName().'\' that was not'
260
+            . ' configured to cascade persist operations for entity: '.self::objToStr($entity).'.'
261 261
             . ' To solve this issue: Either explicitly call EntityManager#persist()'
262 262
             . ' on this unknown entity or configure cascade persist'
263 263
             . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).'
264 264
             . (method_exists($entity, '__toString')
265 265
                 ? ''
266 266
                 : ' If you cannot find out which entity causes the problem implement \''
267
-                . $association->getTargetEntity() . '#__toString()\' to get a clue.'
267
+                . $association->getTargetEntity().'#__toString()\' to get a clue.'
268 268
             );
269 269
     }
270 270
 }
Please login to merge, or discard this patch.