mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-26 01:55:34 +08:00
update to 2.1.3 version
fix an AnnotationParser bug which is stupid
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"description": "High performance QQ robot and web server development framework",
|
"description": "High performance QQ robot and web server development framework",
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"version": "2.1.2",
|
"version": "2.1.3",
|
||||||
"extra": {
|
"extra": {
|
||||||
"exclude_annotate": [
|
"exclude_annotate": [
|
||||||
"src/ZM"
|
"src/ZM"
|
||||||
|
|||||||
@@ -1,8 +1,34 @@
|
|||||||
# 更新日志(v2 版本)
|
# 更新日志(v2 版本)
|
||||||
|
|
||||||
|
## v2.1.3
|
||||||
|
|
||||||
|
> 更新时间:2021.1.2
|
||||||
|
|
||||||
|
- 修复:注解解析器在某种特殊情况下导致的 bug
|
||||||
|
|
||||||
|
## v2.1.2
|
||||||
|
|
||||||
|
> 更新时间:2021.1.2
|
||||||
|
|
||||||
|
- 修复:引入包模式启动时会导致的满屏报错
|
||||||
|
|
||||||
|
## v2.1.1
|
||||||
|
|
||||||
|
> 更新时间:2021.1.2
|
||||||
|
|
||||||
|
- 修复:自定义加载注解选定 composer.json 文件错误的 bug
|
||||||
|
|
||||||
|
## v2.1.0
|
||||||
|
|
||||||
|
> 更新时间:2021.1.2
|
||||||
|
|
||||||
|
- 新增:`@OnOpenEvent`,`@OnCloseEvent`,`@OnMessageEvent`,`@OnRequestEvent`
|
||||||
|
- 优化事件分发器,修复一些事件分发过程中的 bug
|
||||||
|
- 修复 `@CQBefore` 事件的 bug
|
||||||
|
|
||||||
## v2.0.3
|
## v2.0.3
|
||||||
|
|
||||||
> 更新事件:2020.12.31
|
> 更新时间:2020.12.31
|
||||||
|
|
||||||
- 修复:CQBefore 注解事件在 level 低于 200 时无法调用的 bug
|
- 修复:CQBefore 注解事件在 level 低于 200 时无法调用的 bug
|
||||||
- 修复:CQMetaEvent 注解事件调用时报错的 bug
|
- 修复:CQMetaEvent 注解事件调用时报错的 bug
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class AnnotationParser
|
|||||||
|
|
||||||
//预处理1:将适用于每一个函数的注解到类注解重新注解到每个函数下面
|
//预处理1:将适用于每一个函数的注解到类注解重新注解到每个函数下面
|
||||||
if ($vs instanceof ErgodicAnnotation) {
|
if ($vs instanceof ErgodicAnnotation) {
|
||||||
foreach ($this->annotation_map[$v]["methods"] as $method) {
|
foreach (($this->annotation_map[$v]["methods"] ?? []) as $method) {
|
||||||
$copy = clone $vs;
|
$copy = clone $vs;
|
||||||
$copy->method = $method->getName();
|
$copy->method = $method->getName();
|
||||||
$this->annotation_map[$v]["methods_annotations"][$method->getName()][] = $copy;
|
$this->annotation_map[$v]["methods_annotations"][$method->getName()][] = $copy;
|
||||||
@@ -107,7 +107,7 @@ class AnnotationParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
//预处理3:处理每个函数上面的特殊注解,就是需要操作一些东西的
|
//预处理3:处理每个函数上面的特殊注解,就是需要操作一些东西的
|
||||||
foreach ($this->annotation_map[$v]["methods_annotations"] as $method_name => $methods_annotations) {
|
foreach (($this->annotation_map[$v]["methods_annotations"] ?? []) as $method_name => $methods_annotations) {
|
||||||
foreach ($methods_annotations as $method_anno) {
|
foreach ($methods_annotations as $method_anno) {
|
||||||
/** @var AnnotationBase $method_anno */
|
/** @var AnnotationBase $method_anno */
|
||||||
$method_anno->class = $v;
|
$method_anno->class = $v;
|
||||||
@@ -135,11 +135,11 @@ class AnnotationParser
|
|||||||
public function generateAnnotationEvents() {
|
public function generateAnnotationEvents() {
|
||||||
$o = [];
|
$o = [];
|
||||||
foreach ($this->annotation_map as $module => $obj) {
|
foreach ($this->annotation_map as $module => $obj) {
|
||||||
foreach ($obj["class_annotations"] as $class_annotation) {
|
foreach (($obj["class_annotations"] ?? []) as $class_annotation) {
|
||||||
if ($class_annotation instanceof ErgodicAnnotation) continue;
|
if ($class_annotation instanceof ErgodicAnnotation) continue;
|
||||||
else $o[get_class($class_annotation)][] = $class_annotation;
|
else $o[get_class($class_annotation)][] = $class_annotation;
|
||||||
}
|
}
|
||||||
foreach ($obj["methods_annotations"] as $method_name => $methods_annotations) {
|
foreach (($obj["methods_annotations"] ?? []) as $method_name => $methods_annotations) {
|
||||||
foreach ($methods_annotations as $annotation) {
|
foreach ($methods_annotations as $annotation) {
|
||||||
$o[get_class($annotation)][] = $annotation;
|
$o[get_class($annotation)][] = $annotation;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user