@@ -38,13 +38,13 @@ public function loadForDispatching(string $type, array $attributes): iterable
3838 }
3939 }
4040
41- foreach ($ connection ->table ('WebhookWithoutAttribute ' )->get ( ) as $ webhookMap ) {
41+ foreach ($ connection ->table ('WebhookWithoutAttribute ' )->pluck ( ' webhookId ' ) as $ webhookId ) {
4242 /** @phpstan-ignore-next-line */
43- if (array_key_exists ($ webhookMap -> webhookId , $ webhookMatches )) {
43+ if (array_key_exists ($ webhookId , $ webhookMatches )) {
4444 continue ;
4545 }
4646
47- $ webhookMatches [$ webhookMap -> webhookId ] = 0 ;
47+ $ webhookMatches [$ webhookId ] = 0 ;
4848 }
4949
5050 $ webhooks = [];
@@ -158,15 +158,13 @@ private function getWebhooksForAttributes(ConnectionInterface $connection, array
158158 $ attributeIds = $ connection ->table ('WebhookAttribute ' )
159159 ->where ('key ' , '= ' , $ key )
160160 ->where ('value ' , '= ' , $ value )
161- ->get ()
162- ->map (static fn ($ row ) => $ row ->id )
161+ ->pluck ('id ' )
163162 ;
164163 foreach ($ attributeIds as $ attributeId ) {
165164 /** @var Collection<int, int> $webhookIds */
166165 $ webhookIds = $ connection ->table ('WebhookRequiredAttribute ' )
167166 ->where ('webhookAttributeId ' , '= ' , $ attributeId )
168- ->get ()
169- ->map (static fn ($ row ) => $ row ->webhookId )
167+ ->pluck ('webhookId ' )
170168 ;
171169
172170 foreach ($ webhookIds as $ webhookId ) {
0 commit comments