From 9e860cde48dc176f8891f0e279ab0e36080fce38 Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:25:58 +0800 Subject: [PATCH] Optimized phpdoc for @deprecated --- src/ConstEventsNames.php | 2 +- src/Consumer.php | 12 ++++++------ src/ConsumerManager.php | 2 +- src/Subscriber/SnapshotSubscriber.php | 2 +- src/Subscriber/TriggerSubscriber.php | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ConstEventsNames.php b/src/ConstEventsNames.php index 2f006f0..07083bf 100644 --- a/src/ConstEventsNames.php +++ b/src/ConstEventsNames.php @@ -12,7 +12,7 @@ namespace FriendsOfHyperf\Trigger; /** - * @deprecated since v3.1, will removed in 3.2, use \MySQLReplication\Definitions\ConstEventsNames instead + * @deprecated since v3.1, use \MySQLReplication\Definitions\ConstEventsNames instead, will be removed in v3.2 */ enum ConstEventsNames: string { diff --git a/src/Consumer.php b/src/Consumer.php index 4d620dd..215f5dc 100644 --- a/src/Consumer.php +++ b/src/Consumer.php @@ -112,7 +112,7 @@ public function start(): void } /** - * @deprecated use `$this->binLogCurrentSnapshot` instead, will remove in v3.2. + * @deprecated since v3.1, use `$this->binLogCurrentSnapshot` instead, will be removed in v3.2. */ public function getBinLogCurrentSnapshot(): BinLogCurrentSnapshotInterface { @@ -120,7 +120,7 @@ public function getBinLogCurrentSnapshot(): BinLogCurrentSnapshotInterface } /** - * @deprecated use `$this->healthMonitor` instead, will remove in v3.2. + * @deprecated since v3.1, use `$this->healthMonitor` instead, will be removed in v3.2. */ public function getHealthMonitor(): ?HealthMonitor { @@ -128,7 +128,7 @@ public function getHealthMonitor(): ?HealthMonitor } /** - * @deprecated use `$this->name` instead, will remove in v3.2. + * @deprecated since v3.1, use `$this->name` instead, will be removed in v3.2. */ public function getName(): string { @@ -136,7 +136,7 @@ public function getName(): string } /** - * @deprecated use `$this->config->get($key, $default)` instead, will remove in v3.2. + * @deprecated since v3.1, use `$this->config->get($key, $default)` instead, will be removed in v3.2. */ public function getOption(?string $key = null, mixed $default = null): mixed { @@ -148,7 +148,7 @@ public function getOption(?string $key = null, mixed $default = null): mixed } /** - * @deprecated use `$this->connection` instead, will remove in v3.2. + * @deprecated since v3.1, use `$this->connection` instead, will be removed in v3.2. */ public function getConnection(): string { @@ -156,7 +156,7 @@ public function getConnection(): string } /** - * @deprecated use `$this->identifier` instead, will remove in v3.2. + * @deprecated since v3.1, use `$this->identifier` instead, will be removed in v3.2. */ public function getIdentifier(): string { diff --git a/src/ConsumerManager.php b/src/ConsumerManager.php index 39eda2b..97cc898 100644 --- a/src/ConsumerManager.php +++ b/src/ConsumerManager.php @@ -44,7 +44,7 @@ public function register(): void } /** - * @deprecated since v3.1, will removed in v3.2 + * @deprecated since v3.1, will be removed in v3.2 */ public function run(): void { diff --git a/src/Subscriber/SnapshotSubscriber.php b/src/Subscriber/SnapshotSubscriber.php index 867099c..d5ec8af 100644 --- a/src/Subscriber/SnapshotSubscriber.php +++ b/src/Subscriber/SnapshotSubscriber.php @@ -28,7 +28,7 @@ protected function allEvents(EventDTO $event): void $eventInfo = $event->getEventInfo(); $binLogCurrent = match (true) { - method_exists($eventInfo, 'getBinLogCurrent') => $eventInfo->getBinLogCurrent(), // v7.x, @deprecated, will removed in v3.2 + method_exists($eventInfo, 'getBinLogCurrent') => $eventInfo->getBinLogCurrent(), // v7.x, @deprecated since v3.1, will be removed in v3.2 property_exists($eventInfo, 'binLogCurrent') => $eventInfo->binLogCurrent, // @phpstan-ignore property.private default => null, }; diff --git a/src/Subscriber/TriggerSubscriber.php b/src/Subscriber/TriggerSubscriber.php index ae7fbaa..500e3df 100644 --- a/src/Subscriber/TriggerSubscriber.php +++ b/src/Subscriber/TriggerSubscriber.php @@ -117,13 +117,13 @@ protected function allEvents(EventDTO $event): void $this->loop(); $database = match (true) { - method_exists($event, 'getTableMap') => $event->getTableMap()->getDatabase(), // v7.x, @deprecated, will removed in v3.2 + method_exists($event, 'getTableMap') => $event->getTableMap()->getDatabase(), // v7.x, @deprecated, will be removed in v3.2 property_exists($event, 'tableMap') => $event->tableMap->database, // @phpstan-ignore property.private default => null, }; $table = match (true) { - method_exists($event, 'getTableMap') => $event->getTableMap()->getTable(), // v7.x, @deprecated, will removed in v3.2 + method_exists($event, 'getTableMap') => $event->getTableMap()->getTable(), // v7.x, @deprecated, will be removed in v3.2 property_exists($event, 'tableMap') => $event->tableMap->table, // @phpstan-ignore property.private default => null, }; @@ -139,7 +139,7 @@ protected function allEvents(EventDTO $event): void foreach ($this->triggerManager->get($key) as $callable) { $values = match (true) { - method_exists($event, 'getValues') => $event->getValues(), // v7.x, @deprecated, will removed in v3.2 + method_exists($event, 'getValues') => $event->getValues(), // v7.x, @deprecated since v3.1, will be removed in v3.2 property_exists($event, 'values') => $event->values, // @phpstan-ignore property.private default => [], };