@@ -571,11 +571,9 @@ public function getSearchProviderClassName(string $storeName): ?string
571571 }
572572
573573 /**
574- * @param int|string $readPreference
575- *
576574 * @throws ConfigException
577575 */
578- public function getDatabase (string $ storeName , ?string $ dataSource = null , $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Database
576+ public function getDatabase (string $ storeName , ?string $ dataSource = null , string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): Database
579577 {
580578 if (!isset ($ this ->dbConfig [$ storeName ])) {
581579 throw new ConfigException (sprintf ("Store name '%s' not in configuration " , $ storeName ));
@@ -593,11 +591,9 @@ public function getDatabase(string $storeName, ?string $dataSource = null, $read
593591 }
594592
595593 /**
596- * @param int|string $readPreference
597- *
598594 * @throws ConfigException
599595 */
600- public function getCollectionForCBD (string $ storeName , string $ podName , $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Collection
596+ public function getCollectionForCBD (string $ storeName , string $ podName , string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): Collection
601597 {
602598 if (isset ($ this ->podConnections [$ storeName ], $ this ->podConnections [$ storeName ][$ podName ])) {
603599 return $ this ->getMongoCollection (
@@ -610,11 +606,9 @@ public function getCollectionForCBD(string $storeName, string $podName, $readPre
610606 }
611607
612608 /**
613- * @param int|string $readPreference
614- *
615609 * @throws ConfigException
616610 */
617- public function getCollectionForView (string $ storeName , string $ viewId , $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Collection
611+ public function getCollectionForView (string $ storeName , string $ viewId , string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): Collection
618612 {
619613 if (!isset ($ this ->viewSpecs [$ storeName ][$ viewId ])) {
620614 throw new ConfigException (sprintf ("View id '%s' not in configuration for store '%s' " , $ viewId , $ storeName ));
@@ -629,11 +623,9 @@ public function getCollectionForView(string $storeName, string $viewId, $readPre
629623 }
630624
631625 /**
632- * @param int|string $readPreference
633- *
634626 * @throws ConfigException
635627 */
636- public function getCollectionForSearchDocument (string $ storeName , string $ searchDocumentId , $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Collection
628+ public function getCollectionForSearchDocument (string $ storeName , string $ searchDocumentId , string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): Collection
637629 {
638630 if (!isset ($ this ->searchDocSpecs [$ storeName ][$ searchDocumentId ])) {
639631 throw new ConfigException (sprintf ("Search document id '%s' not in configuration for store '%s' " , $ searchDocumentId , $ storeName ));
@@ -648,11 +640,9 @@ public function getCollectionForSearchDocument(string $storeName, string $search
648640 }
649641
650642 /**
651- * @param int|string $readPreference
652- *
653643 * @throws ConfigException
654644 */
655- public function getCollectionForTable (string $ storeName , string $ tableId , $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Collection
645+ public function getCollectionForTable (string $ storeName , string $ tableId , string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): Collection
656646 {
657647 if (!isset ($ this ->tableSpecs [$ storeName ][$ tableId ])) {
658648 throw new ConfigException (sprintf ("Table id '%s' not in configuration for store '%s' " , $ tableId , $ storeName ));
@@ -667,13 +657,11 @@ public function getCollectionForTable(string $storeName, string $tableId, $readP
667657 }
668658
669659 /**
670- * @param int|string $readPreference
671- *
672660 * @return Collection[]
673661 *
674662 * @throws ConfigException
675663 */
676- public function getCollectionsForTables (string $ storeName , array $ tables = [], $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): array
664+ public function getCollectionsForTables (string $ storeName , array $ tables = [], string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): array
677665 {
678666 if (!isset ($ this ->tableSpecs [$ storeName ])) {
679667 return [];
@@ -704,13 +692,11 @@ public function getCollectionsForTables(string $storeName, array $tables = [], $
704692 }
705693
706694 /**
707- * @param int|string $readPreference
708- *
709695 * @return Collection[]
710696 *
711697 * @throws ConfigException
712698 */
713- public function getCollectionsForViews (string $ storeName , array $ views = [], $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): array
699+ public function getCollectionsForViews (string $ storeName , array $ views = [], string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): array
714700 {
715701 if (!isset ($ this ->viewSpecs [$ storeName ])) {
716702 return [];
@@ -741,13 +727,11 @@ public function getCollectionsForViews(string $storeName, array $views = [], $re
741727 }
742728
743729 /**
744- * @param int|string $readPreference
745- *
746730 * @return Collection[]
747731 *
748732 * @throws ConfigException
749733 */
750- public function getCollectionsForSearch (string $ storeName , array $ searchSpecIds = [], $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): array
734+ public function getCollectionsForSearch (string $ storeName , array $ searchSpecIds = [], string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): array
751735 {
752736 if (!isset ($ this ->searchDocSpecs [$ storeName ])) {
753737 return [];
@@ -777,43 +761,31 @@ public function getCollectionsForSearch(string $storeName, array $searchSpecIds
777761 return $ collections ;
778762 }
779763
780- /**
781- * @param int|string $readPreference
782- */
783- public function getCollectionForTTLCache (string $ storeName , $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Collection
764+ public function getCollectionForTTLCache (string $ storeName , string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): Collection
784765 {
785766 return $ this ->getMongoCollection (
786767 $ this ->getDatabase ($ storeName , $ this ->dbConfig [$ storeName ]['data_source ' ], $ readPreference ),
787768 TTL_CACHE_COLLECTION
788769 );
789770 }
790771
791- /**
792- * @param int|string $readPreference
793- */
794- public function getCollectionForLocks (string $ storeName , $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Collection
772+ public function getCollectionForLocks (string $ storeName , string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): Collection
795773 {
796774 return $ this ->getMongoCollection (
797775 $ this ->getDatabase ($ storeName , $ this ->dbConfig [$ storeName ]['data_source ' ], $ readPreference ),
798776 LOCKS_COLLECTION
799777 );
800778 }
801779
802- /**
803- * @param int|string $readPreference
804- */
805- public function getCollectionForManualRollbackAudit (string $ storeName , $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Collection
780+ public function getCollectionForManualRollbackAudit (string $ storeName , string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): Collection
806781 {
807782 return $ this ->getMongoCollection (
808783 $ this ->getDatabase ($ storeName , $ this ->dbConfig [$ storeName ]['data_source ' ], $ readPreference ),
809784 AUDIT_MANUAL_ROLLBACKS_COLLECTION
810785 );
811786 }
812787
813- /**
814- * @param int|string $readPreference
815- */
816- public function getCollectionForJobGroups (string $ storeName , $ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Collection
788+ public function getCollectionForJobGroups (string $ storeName , string $ readPreference = ReadPreference::PRIMARY_PREFERRED ): Collection
817789 {
818790 return $ this ->getMongoCollection (
819791 $ this ->getDatabase ($ storeName , $ this ->dbConfig [$ storeName ]['data_source ' ], $ readPreference ),
@@ -822,11 +794,11 @@ public function getCollectionForJobGroups(string $storeName, $readPreference = R
822794 }
823795
824796 /**
825- * @param int| string $readPreference
797+ * @param string $readPreference
826798 *
827799 * @throws ConfigException
828800 */
829- public function getTransactionLogDatabase ($ readPreference = ReadPreference::RP_PRIMARY_PREFERRED ): Database
801+ public function getTransactionLogDatabase ($ readPreference = ReadPreference::PRIMARY_PREFERRED ): Database
830802 {
831803 $ client = $ this ->getConnectionForDataSource ($ this ->tConfig ['data_source ' ]);
832804 $ db = $ client ->selectDatabase ($ this ->tConfig ['database ' ]);
0 commit comments