@@ -49,10 +49,7 @@ private function parseAnnotations(EventParam $e)
49
49
RequestContext::create ();
50
50
RequestContext::set ('server ' , $ server );
51
51
/** @var \Imi\Rpc\Route\IRoute $route */
52
- // $route = $server->getBean('RpcRoute');
53
52
$ route = $ server ->getBean ($ server ->getRouteClass ());
54
- $ serverTypeName = $ this ->getServerTypeName (BeanFactory::getObjectClass ($ server ));
55
- // $eventName = 'IMI.ROUTE.INIT.DEFAULT:' . $serverTypeName;
56
53
foreach ($ controllerParser ->getByServer ($ name , $ controllerAnnotationClass ) as $ className => $ classItem )
57
54
{
58
55
$ classAnnotation = $ classItem ->getAnnotation ();
@@ -62,16 +59,6 @@ private function parseAnnotations(EventParam $e)
62
59
$ routes = AnnotationManager::getMethodAnnotations ($ className , $ methodName , $ routeAnnotationClass );
63
60
if (!isset ($ routes [0 ]))
64
61
{
65
- // $data = compact('className', 'classAnnotation', 'methodName');
66
- // $result = null;
67
- // $data['result'] = &$result;
68
- // Event::trigger($eventName, $data);
69
- // if(null !== $result)
70
- // {
71
- // $routes = [
72
- // $result
73
- // ];
74
- // }
75
62
$ routes = [
76
63
$ route ->getDefaultRouteAnnotation ($ className , $ methodName , $ classAnnotation ),
77
64
];
@@ -89,21 +76,4 @@ private function parseAnnotations(EventParam $e)
89
76
}
90
77
}
91
78
92
- /**
93
- * 获取服务器类型名称
94
- *
95
- * @param string $className
96
- * @return string|boolean
97
- */
98
- private function getServerTypeName ($ className )
99
- {
100
- if (\preg_match ('/Imi \\\\Server \\\\([^ \\\\]+) \\\\Server/ ' , $ className , $ matches ) > 0 )
101
- {
102
- return $ matches [1 ];
103
- }
104
- else
105
- {
106
- return false ;
107
- }
108
- }
109
79
}
0 commit comments