@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $expectedLockVersion = ($expectedLockVersion instanceof \DateTime) ? $expectedLockVersion->getTimestamp() : $expectedLockVersion; |
58 | 58 | $actualLockVersion = ($actualLockVersion instanceof \DateTime) ? $actualLockVersion->getTimestamp() : $actualLockVersion; |
59 | 59 | |
60 | - return new self('The optimistic lock failed, version ' . $expectedLockVersion . ' was expected, but is actually ' . $actualLockVersion, $entity); |
|
60 | + return new self('The optimistic lock failed, version '.$expectedLockVersion.' was expected, but is actually '.$actualLockVersion, $entity); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -67,6 +67,6 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public static function notVersioned($entityName) |
69 | 69 | { |
70 | - return new self('Cannot obtain optimistic lock on unversioned entity ' . $entityName, null); |
|
70 | + return new self('Cannot obtain optimistic lock on unversioned entity '.$entityName, null); |
|
71 | 71 | } |
72 | 72 | } |
@@ -14,6 +14,6 @@ |
||
14 | 14 | { |
15 | 15 | public static function schemaToolFailure(string $sql, Throwable $e) : self |
16 | 16 | { |
17 | - return new self("Schema-Tool failed with Error '" . $e->getMessage() . "' while executing DDL: " . $sql, 0, $e); |
|
17 | + return new self("Schema-Tool failed with Error '".$e->getMessage()."' while executing DDL: ".$sql, 0, $e); |
|
18 | 18 | } |
19 | 19 | } |
@@ -61,28 +61,28 @@ discard block |
||
61 | 61 | $fh = fopen($this->file, 'xb+'); |
62 | 62 | |
63 | 63 | if (count($identityMap) === 0) { |
64 | - fwrite($fh, 'Flush Operation [' . $this->context . "] - Empty identity map.\n"); |
|
64 | + fwrite($fh, 'Flush Operation ['.$this->context."] - Empty identity map.\n"); |
|
65 | 65 | |
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
69 | - fwrite($fh, 'Flush Operation [' . $this->context . "] - Dumping identity map:\n"); |
|
69 | + fwrite($fh, 'Flush Operation ['.$this->context."] - Dumping identity map:\n"); |
|
70 | 70 | |
71 | 71 | foreach ($identityMap as $className => $map) { |
72 | - fwrite($fh, 'Class: ' . $className . "\n"); |
|
72 | + fwrite($fh, 'Class: '.$className."\n"); |
|
73 | 73 | |
74 | 74 | foreach ($map as $entity) { |
75 | - fwrite($fh, ' Entity: ' . $this->getIdString($entity, $uow) . ' ' . spl_object_id($entity) . "\n"); |
|
75 | + fwrite($fh, ' Entity: '.$this->getIdString($entity, $uow).' '.spl_object_id($entity)."\n"); |
|
76 | 76 | fwrite($fh, " Associations:\n"); |
77 | 77 | |
78 | 78 | $cm = $em->getClassMetadata($className); |
79 | 79 | |
80 | 80 | foreach ($cm->getDeclaredPropertiesIterator() as $field => $association) { |
81 | - if (! ($association instanceof AssociationMetadata)) { |
|
81 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
82 | 82 | continue; |
83 | 83 | } |
84 | 84 | |
85 | - fwrite($fh, ' ' . $field . ' '); |
|
85 | + fwrite($fh, ' '.$field.' '); |
|
86 | 86 | |
87 | 87 | $value = $association->getValue($entity); |
88 | 88 | |
@@ -97,21 +97,21 @@ discard block |
||
97 | 97 | fwrite($fh, '[PROXY] '); |
98 | 98 | } |
99 | 99 | |
100 | - fwrite($fh, $this->getIdString($value, $uow) . ' ' . spl_object_id($value) . "\n"); |
|
100 | + fwrite($fh, $this->getIdString($value, $uow).' '.spl_object_id($value)."\n"); |
|
101 | 101 | } else { |
102 | 102 | $initialized = ! ($value instanceof PersistentCollection) || $value->isInitialized(); |
103 | 103 | |
104 | 104 | if ($initialized) { |
105 | - fwrite($fh, '[INITIALIZED] ' . $this->getType($value) . ' ' . count($value) . " elements\n"); |
|
105 | + fwrite($fh, '[INITIALIZED] '.$this->getType($value).' '.count($value)." elements\n"); |
|
106 | 106 | |
107 | 107 | foreach ($value as $obj) { |
108 | - fwrite($fh, ' ' . $this->getIdString($obj, $uow) . ' ' . spl_object_id($obj) . "\n"); |
|
108 | + fwrite($fh, ' '.$this->getIdString($obj, $uow).' '.spl_object_id($obj)."\n"); |
|
109 | 109 | } |
110 | 110 | } else { |
111 | - fwrite($fh, '[PROXY] ' . $this->getType($value) . " unknown element size\n"); |
|
111 | + fwrite($fh, '[PROXY] '.$this->getType($value)." unknown element size\n"); |
|
112 | 112 | |
113 | 113 | foreach ($value->unwrap() as $obj) { |
114 | - fwrite($fh, ' ' . $this->getIdString($obj, $uow) . ' ' . spl_object_id($obj) . "\n"); |
|
114 | + fwrite($fh, ' '.$this->getIdString($obj, $uow).' '.spl_object_id($obj)."\n"); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $idstring = ''; |
151 | 151 | |
152 | 152 | foreach ($ids as $k => $v) { |
153 | - $idstring .= $k . '=' . $v; |
|
153 | + $idstring .= $k.'='.$v; |
|
154 | 154 | } |
155 | 155 | } else { |
156 | 156 | $idstring = 'NEWOBJECT '; |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $metadata = $it->current(); |
57 | 57 | |
58 | 58 | foreach ($this->filter as $filter) { |
59 | - $pregResult = preg_match('/' . $filter . '/', $metadata->getClassName()); |
|
59 | + $pregResult = preg_match('/'.$filter.'/', $metadata->getClassName()); |
|
60 | 60 | |
61 | 61 | if ($pregResult === false) { |
62 | 62 | throw new \RuntimeException( |
@@ -28,9 +28,9 @@ |
||
28 | 28 | */ |
29 | 29 | public function getSql(SqlWalker $sqlWalker) |
30 | 30 | { |
31 | - return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause( |
|
31 | + return 'ROW_NUMBER() OVER('.trim($sqlWalker->walkOrderByClause( |
|
32 | 32 | $this->orderByClause |
33 | - )) . ')'; |
|
33 | + )).')'; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -89,7 +89,7 @@ |
||
89 | 89 | [$pathExpression] |
90 | 90 | ); |
91 | 91 | $expression = new InExpression($arithmeticExpression); |
92 | - $expression->literals[] = new InputParameter(':' . self::PAGINATOR_ID_ALIAS); |
|
92 | + $expression->literals[] = new InputParameter(':'.self::PAGINATOR_ID_ALIAS); |
|
93 | 93 | } else { |
94 | 94 | $expression = new NullComparisonExpression($pathExpression); |
95 | 95 | $expression->not = false; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | /** @var ClassMetadata $metadata */ |
43 | 43 | $metadata = $event->getClassMetadata(); |
44 | 44 | |
45 | - if (! isset($this->entityListeners[$metadata->getClassName()])) { |
|
45 | + if ( ! isset($this->entityListeners[$metadata->getClassName()])) { |
|
46 | 46 | return; |
47 | 47 | } |
48 | 48 |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public static function registerAutoloadDirectory($directory) |
33 | 33 | { |
34 | - if (! class_exists('Doctrine\Common\ClassLoader', false)) { |
|
35 | - require_once $directory . '/Doctrine/Common/ClassLoader.php'; |
|
34 | + if ( ! class_exists('Doctrine\Common\ClassLoader', false)) { |
|
35 | + require_once $directory.'/Doctrine/Common/ClassLoader.php'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $loader = new ClassLoader('Doctrine', $directory); |
39 | 39 | $loader->register(); |
40 | 40 | |
41 | - $loader = new ClassLoader('Symfony\Component', $directory . '/Doctrine'); |
|
41 | + $loader = new ClassLoader('Symfony\Component', $directory.'/Doctrine'); |
|
42 | 42 | $loader->register(); |
43 | 43 | } |
44 | 44 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | { |
106 | 106 | $cache = self::createCacheInstance($isDevMode, $cache); |
107 | 107 | |
108 | - if (! $cache instanceof CacheProvider) { |
|
108 | + if ( ! $cache instanceof CacheProvider) { |
|
109 | 109 | return $cache; |
110 | 110 | } |
111 | 111 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $namespace .= ':'; |
116 | 116 | } |
117 | 117 | |
118 | - $cache->setNamespace($namespace . 'dc2_' . md5($proxyDir) . '_'); // to avoid collisions |
|
118 | + $cache->setNamespace($namespace.'dc2_'.md5($proxyDir).'_'); // to avoid collisions |
|
119 | 119 | |
120 | 120 | return $cache; |
121 | 121 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public static function scheduleInsertForManagedEntity($entity) |
31 | 31 | { |
32 | - return new self('A managed+dirty entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
32 | + return new self('A managed+dirty entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public static function scheduleInsertForRemovedEntity($entity) |
41 | 41 | { |
42 | - return new self('Removed entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
42 | + return new self('Removed entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public static function scheduleInsertTwice($entity) |
51 | 51 | { |
52 | - return new self('Entity ' . self::objToStr($entity) . ' can not be scheduled for insertion twice.'); |
|
52 | + return new self('Entity '.self::objToStr($entity).' can not be scheduled for insertion twice.'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public static function entityWithoutIdentity($className, $entity) |
62 | 62 | { |
63 | 63 | return new self( |
64 | - "The given entity of type '" . $className . "' (" . self::objToStr($entity) . ') has no identity/no ' . |
|
64 | + "The given entity of type '".$className."' (".self::objToStr($entity).') has no identity/no '. |
|
65 | 65 | 'id values set. It cannot be added to the identity map.' |
66 | 66 | ); |
67 | 67 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public static function readOnlyRequiresManagedEntity($entity) |
75 | 75 | { |
76 | - return new self('Only managed entities can be marked or checked as read only. But ' . self::objToStr($entity) . ' is not'); |
|
76 | + return new self('Only managed entities can be marked or checked as read only. But '.self::objToStr($entity).' is not'); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public static function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations) |
85 | 85 | { |
86 | 86 | $errorMessages = array_map( |
87 | - function (array $newEntityWithAssociation) : string { |
|
87 | + function(array $newEntityWithAssociation) : string { |
|
88 | 88 | [$associationMetadata, $entity] = $newEntityWithAssociation; |
89 | 89 | |
90 | 90 | 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 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 |
||
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 | } |