1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-06 18:04:03 +00:00

Improve $channelOverrides docblock

This commit is contained in:
lukinovec 2026-04-14 10:07:16 +02:00
parent 06472d5cae
commit 9ea3813d28

View file

@ -46,10 +46,12 @@ class LogTenancyBootstrapper implements TenancyBootstrapper
* All channels included here will be configured using the provided override.
*
* Examples:
* - Array mapping (the default approach): ['slack' => ['url' => 'webhookUrl']] maps $tenant->webhookUrl to slack.url (if $tenant->webhookUrl is not null, otherwise, the override is ignored)
* - Closure: ['slack' => fn (Tenant $tenant, array $channel) => array_merge($channel, ['url' => $tenant->slackUrl])] (the closure should return the whole channel's config)
* - Array mapping (the default approach): ['slack' => ['url' => 'webhookUrl']]
* - this maps $tenant->webhookUrl to slack.url (if $tenant->webhookUrl is not null, otherwise, the override is ignored)
* - Closure: ['slack' => fn (Tenant $tenant, array $channel) => array_merge($channel, ['url' => $tenant->slackUrl])]
* - this merges ['url' => $tenant->slackUrl] into the channel's config.
*
* In both cases, the override should be an array.
* So the channel overrides can be arrays and closures that return arrays.
*/
public static array $channelOverrides = [];