Skip to content

Commit

Permalink
修复一些注解问题 (#605)
Browse files Browse the repository at this point in the history
* 修复注解使用错误

* 修复Lockable注解原生类型
  • Loading branch information
Yurunsoft authored Oct 25, 2023
1 parent 99258de commit 5f4c642
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Components/amqp/example/AMQP/Test/TestPublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* @Bean("TestPublisher")
*
* @Publisher(tag="tag-imi", queue="queue-imi-2", exchange="exchange-imi", routingKey="imi-2")
* @Publisher(queue="queue-imi-2", exchange="exchange-imi", routingKey="imi-2")
*
* @Queue(name="queue-imi-2", routingKey="imi-2")
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/amqp/src/Queue/AMQPQueueDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* AMQP 队列驱动.
*
* @Bean(name="AMQPQueueDriver", recursive=false)
* @Bean(name="AMQPQueueDriver", recursion=false)
*/
class AMQPQueueDriver implements IQueueDriver
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/grpc/src/Listener/WorkerExit.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/**
* @Listener(eventName="IMI.MAIN_SERVER.WORKER.EXIT", priority=Imi\Util\ImiPriority::IMI_MIN)
* @Listener("IMI.PROCESS.END", priority=-19940311)
* @Listener(eventName="IMI.PROCESS.END", priority=-19940311)
*/
class WorkerExit implements IEventListener
{
Expand Down
20 changes: 10 additions & 10 deletions src/Lock/Annotation/Lockable.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
*
* @Target({"METHOD", "ANNOTATION"})
*
* @property string|null $id 锁ID;支持{id}、{data.name}形式,代入参数;如果为null,则使用类名+方法名+全部参数,序列化后hash
* @property string|null $type 锁类型,如:RedisLock;为null则使用默认锁类型(@currentServer.lock.defaultType)
* @property int|null $waitTimeout 等待锁超时时间,单位:毫秒,0为不限制
* @property int|null $lockExpire 锁超时时间,单位:毫秒
* @property array $options 锁初始化参数
* @property callable|null $afterLock 当获得锁后执行的回调。该回调返回非 null 则不执行加锁后的方法,本回调的返回值将作为返回值;一般用于防止缓存击穿,获得锁后再做一次检测;如果为{"$this", "methodName"}格式,$this将会被替换为当前类,方法必须为 publicprotected
* @property bool $useConfig 允许注解引用配置文件中相同锁id的配置
* @property bool|null $timeoutException 执行超时抛出异常
* @property bool|null $unlockException 解锁失败抛出异常
* @property string|null $id 锁ID;支持{id}、{data.name}形式,代入参数;如果为null,则使用类名+方法名+全部参数,序列化后hash
* @property string|null $type 锁类型,如:RedisLock;为null则使用默认锁类型(@currentServer.lock.defaultType)
* @property int|null $waitTimeout 等待锁超时时间,单位:毫秒,0为不限制
* @property int|null $lockExpire 锁超时时间,单位:毫秒
* @property array $options 锁初始化参数
* @property callable|array|null $afterLock 当获得锁后执行的回调。该回调返回非 null 则不执行加锁后的方法,本回调的返回值将作为返回值;一般用于防止缓存击穿,获得锁后再做一次检测;如果为{"$this", "methodName"}格式,$this将会被替换为当前类,方法必须为 publicprotected
* @property bool $useConfig 允许注解引用配置文件中相同锁id的配置
* @property bool|null $timeoutException 执行超时抛出异常
* @property bool|null $unlockException 解锁失败抛出异常
*/
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class Lockable extends Base
Expand All @@ -34,7 +34,7 @@ public function __construct(
?int $waitTimeout = null,
?int $lockExpire = null,
array $options = [],
?callable $afterLock = null,
callable|array|null $afterLock = null,
bool $useConfig = true,
?bool $timeoutException = null,
?bool $unlockException = null
Expand Down

0 comments on commit 5f4c642

Please sign in to comment.