diff --git a/Firestore/src/DocumentReference.php b/Firestore/src/DocumentReference.php index 843e73916ee..79e824d3df6 100644 --- a/Firestore/src/DocumentReference.php +++ b/Firestore/src/DocumentReference.php @@ -418,7 +418,7 @@ function ($collectionId) { */ protected function batchFactory() { - if (!class_exists(WriteBatch::class)) { + if (!class_exists(WriteBatch::class, false)) { class_alias(BulkWriter::class, WriteBatch::class); } return new BulkWriter( diff --git a/Firestore/src/FirestoreClient.php b/Firestore/src/FirestoreClient.php index 39db0de53ed..23e93c09539 100644 --- a/Firestore/src/FirestoreClient.php +++ b/Firestore/src/FirestoreClient.php @@ -178,7 +178,7 @@ public function __construct(array $config = []) */ public function batch() { - if (!class_exists(WriteBatch::class)) { + if (!class_exists(WriteBatch::class, false)) { class_alias(BulkWriter::class, WriteBatch::class); } return new BulkWriter(