改名
This commit is contained in:
@@ -149,9 +149,9 @@ class Node extends Application
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @var Annotation $annotation */
|
/** @var Annotation $annotation */
|
||||||
$annotation = Snowflake::createObject(Annotation::class);
|
$annotation = Snowflake::get()->annotation->http;
|
||||||
if (!empty($methods)) {
|
if (!empty($methods = $annotation->getAnnotation(Annotation::class))) {
|
||||||
$this->_interceptors = $annotation->instance($reflect, $action);
|
$this->_interceptors = $annotation->instance($reflect, $action, $methods);
|
||||||
}
|
}
|
||||||
return [$reflect->newInstance(), $action];
|
return [$reflect->newInstance(), $action];
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
|
|||||||
@@ -50,14 +50,13 @@ abstract class BaseAnnotation extends Component
|
|||||||
/**
|
/**
|
||||||
* @param ReflectionClass $reflect
|
* @param ReflectionClass $reflect
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @param array $rules
|
* @param array $annotations
|
||||||
* @return array
|
* @return array
|
||||||
|
* @throws ReflectionException
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function instance($reflect, $method = '', $rules = [])
|
public function instance($reflect, $method = '', $annotations = [])
|
||||||
{
|
{
|
||||||
$annotations = $this->getPrivates($reflect);
|
|
||||||
|
|
||||||
$classMethods = $reflect->getMethods(ReflectionMethod::IS_PUBLIC);
|
$classMethods = $reflect->getMethods(ReflectionMethod::IS_PUBLIC);
|
||||||
if (!$reflect->isInstantiable()) {
|
if (!$reflect->isInstantiable()) {
|
||||||
throw new Exception('Class ' . $reflect->getName() . ' cannot be instantiated.');
|
throw new Exception('Class ' . $reflect->getName() . ' cannot be instantiated.');
|
||||||
|
|||||||
Reference in New Issue
Block a user