@@ -192,22 +192,41 @@ private function fetchNames(string $table, string $nameColumn, array $ids): arra
192192 */
193193 private function resolveObjectName (array $ share , array $ tableNames , array $ viewNames , array $ contextNames ): string {
194194 $ nodeId = (int )$ share ['node_id ' ];
195- return match ($ share ['node_type ' ]) {
196- self ::NODE_TYPE_TABLE => $ this ->l10n ->t ('%s (Table) ' , [$ tableNames [$ nodeId ] ?? $ this ->l10n ->t ('Table %s ' , [$ nodeId ])]),
197- self ::NODE_TYPE_VIEW => $ this ->l10n ->t ('%s (View) ' , [$ viewNames [$ nodeId ] ?? $ this ->l10n ->t ('View %s ' , [$ nodeId ])]),
198- self ::NODE_TYPE_CONTEXT => $ this ->l10n ->t ('%s (Context) ' , [$ contextNames [$ nodeId ] ?? $ this ->l10n ->t ('Context %s ' , [$ nodeId ])]),
199- default => $ this ->l10n ->t ('Unknown %s ' , [$ nodeId ]),
200- };
195+ $ nodeType = (string )$ share ['node_type ' ];
196+ if ($ nodeType === self ::NODE_TYPE_TABLE ) {
197+ return $ this ->l10n ->t ('%s (Table) ' , [$ tableNames [$ nodeId ] ?? $ this ->l10n ->t ('Table %s ' , [$ nodeId ])]);
198+ }
199+ if ($ nodeType === self ::NODE_TYPE_VIEW ) {
200+ return $ this ->l10n ->t ('%s (View) ' , [$ viewNames [$ nodeId ] ?? $ this ->l10n ->t ('View %s ' , [$ nodeId ])]);
201+ }
202+ if ($ nodeType === self ::NODE_TYPE_CONTEXT ) {
203+ return $ this ->l10n ->t ('%s (Context) ' , [$ contextNames [$ nodeId ] ?? $ this ->l10n ->t ('Context %s ' , [$ nodeId ])]);
204+ }
205+ $ this ->logger ->warning (
206+ 'Tables ShareReview: unknown node type {type} for share node {id} ' ,
207+ ['type ' => $ nodeType , 'id ' => $ nodeId ]
208+ );
209+ return $ this ->l10n ->t ('Unknown %s ' , [$ nodeId ]);
201210 }
202211
203212 private function mapReceiverType (string $ receiverType ): int {
204- return match ($ receiverType ) {
205- 'user ' => IShare::TYPE_USER ,
206- 'group ' => IShare::TYPE_GROUP ,
207- 'link ' => IShare::TYPE_LINK ,
208- 'circle ' => IShare::TYPE_CIRCLE ,
209- default => IShare::TYPE_USER ,
210- };
213+ if ($ receiverType === 'user ' ) {
214+ return IShare::TYPE_USER ;
215+ }
216+ if ($ receiverType === 'group ' ) {
217+ return IShare::TYPE_GROUP ;
218+ }
219+ if ($ receiverType === 'link ' ) {
220+ return IShare::TYPE_LINK ;
221+ }
222+ if ($ receiverType === 'circle ' ) {
223+ return IShare::TYPE_CIRCLE ;
224+ }
225+ $ this ->logger ->warning (
226+ 'Tables ShareReview: unknown receiver type {type}, falling back to user share type ' ,
227+ ['type ' => $ receiverType ]
228+ );
229+ return IShare::TYPE_USER ;
211230 }
212231
213232 /** @param array<string, mixed> $share */
0 commit comments