@@ -30,7 +30,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 it is fetched ' . |
|
157 | + return new self('Entity '.self::objToStr($entity).' is not managed. An entity is managed if it is fetched '. |
|
158 | 158 | 'from the database or registered as new through EntityManager#persist'); |
159 | 159 | } |
160 | 160 | |
@@ -166,7 +166,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | private static function objToStr($obj) : string |
248 | 248 | { |
249 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
249 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -255,15 +255,15 @@ discard block |
||
255 | 255 | private static function newEntityFoundThroughRelationshipMessage(AssociationMetadata $association, $entity) : string |
256 | 256 | { |
257 | 257 | return 'A new entity was found through the relationship \'' |
258 | - . $association->getSourceEntity() . '#' . $association->getName() . '\' that was not' |
|
259 | - . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.' |
|
258 | + . $association->getSourceEntity().'#'.$association->getName().'\' that was not' |
|
259 | + . ' configured to cascade persist operations for entity: '.self::objToStr($entity).'.' |
|
260 | 260 | . ' To solve this issue: Either explicitly call EntityManager#persist()' |
261 | 261 | . ' on this unknown entity or configure cascade persist' |
262 | 262 | . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).' |
263 | 263 | . (method_exists($entity, '__toString') |
264 | 264 | ? '' |
265 | 265 | : ' If you cannot find out which entity causes the problem implement \'' |
266 | - . $association->getTargetEntity() . '#__toString()\' to get a clue.' |
|
266 | + . $association->getTargetEntity().'#__toString()\' to get a clue.' |
|
267 | 267 | ); |
268 | 268 | } |
269 | 269 | } |