61
61
use function is_object ;
62
62
use function is_scalar ;
63
63
use function is_string ;
64
- use function spl_object_hash ;
64
+ use function spl_object_id ;
65
65
use function sprintf ;
66
66
use function strpos ;
67
67
use function strtolower ;
@@ -96,14 +96,14 @@ final class DocumentPersister
96
96
/**
97
97
* Array of queued inserts for the persister to insert.
98
98
*
99
- * @var array<string , object>
99
+ * @var array<int , object>
100
100
*/
101
101
private array $ queuedInserts = [];
102
102
103
103
/**
104
104
* Array of queued inserts for the persister to insert.
105
105
*
106
- * @var array<string , object>
106
+ * @var array<int , object>
107
107
*/
108
108
private array $ queuedUpserts = [];
109
109
@@ -136,15 +136,15 @@ public function __construct(
136
136
$ this ->bucket = $ dm ->getDocumentBucket ($ class ->name );
137
137
}
138
138
139
- /** @return array<string , object> */
139
+ /** @return array<int , object> */
140
140
public function getInserts (): array
141
141
{
142
142
return $ this ->queuedInserts ;
143
143
}
144
144
145
145
public function isQueuedForInsert (object $ document ): bool
146
146
{
147
- return isset ($ this ->queuedInserts [spl_object_hash ($ document )]);
147
+ return isset ($ this ->queuedInserts [spl_object_id ($ document )]);
148
148
}
149
149
150
150
/**
@@ -153,18 +153,18 @@ public function isQueuedForInsert(object $document): bool
153
153
*/
154
154
public function addInsert (object $ document ): void
155
155
{
156
- $ this ->queuedInserts [spl_object_hash ($ document )] = $ document ;
156
+ $ this ->queuedInserts [spl_object_id ($ document )] = $ document ;
157
157
}
158
158
159
- /** @return array<string , object> */
159
+ /** @return array<int , object> */
160
160
public function getUpserts (): array
161
161
{
162
162
return $ this ->queuedUpserts ;
163
163
}
164
164
165
165
public function isQueuedForUpsert (object $ document ): bool
166
166
{
167
- return isset ($ this ->queuedUpserts [spl_object_hash ($ document )]);
167
+ return isset ($ this ->queuedUpserts [spl_object_id ($ document )]);
168
168
}
169
169
170
170
/**
@@ -173,7 +173,7 @@ public function isQueuedForUpsert(object $document): bool
173
173
*/
174
174
public function addUpsert (object $ document ): void
175
175
{
176
- $ this ->queuedUpserts [spl_object_hash ($ document )] = $ document ;
176
+ $ this ->queuedUpserts [spl_object_id ($ document )] = $ document ;
177
177
}
178
178
179
179
/**
0 commit comments