@@ -51,7 +51,7 @@ |
||
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 | ]; |
@@ -39,7 +39,7 @@ |
||
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); |
@@ -32,8 +32,8 @@ |
||
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( |
@@ -15,12 +15,12 @@ |
||
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( |
@@ -66,7 +66,7 @@ |
||
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 | } |
@@ -10,8 +10,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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'); |
@@ -34,7 +34,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function exportClassMetadata(ClassMetadataInfo $metadata): string |
43 | 43 | { |
44 | 44 | $xml = new SimpleXmlElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><doctrine-mapping ". |
45 | - "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" " . |
|
45 | + "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" ". |
|
46 | 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 | |
@@ -98,7 +98,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -253,7 +253,7 @@ |
||
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']]; |