OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace Leantime\Core\Events\Concerns;
use Leantime\Core\Events\EventDispatcher;
/**
* Shared behavior for class-based domain events.
*
* Provides the static dispatch() ergonomic and a default empty legacyHooks() so events
* introduced after the class-based system don't need to declare one:
*
* TicketUpdated::dispatch(ticketId: $id);
*
* Do NOT combine with Laravel's Dispatchable trait — both define dispatch(), and the
* Dispatchable version routes through the generic object path instead of the
* LeantimeEvent fast path.
*/
trait InteractsWithEvents
{
/**
* Default: no legacy string names. Override during the migration window with the
* exact historical leantime.* name of the CURRENT emit site — rebuilt from a
* `legacyHook: __FUNCTION__` constructor discriminator when several methods
* historically fired the same raw hook (see the LeantimeEvent docblock).
*
* @return array<int, string>
*/
public function legacyHooks(): array
{
return [];
}
/**
* Construct and dispatch this event through the Leantime event dispatcher.
* Arguments (named arguments included) are forwarded to the constructor.
*/
public static function dispatch(mixed ...$args): void
{
EventDispatcher::dispatch_event(new static(...$args));
}
}