This commit is contained in:
2021-04-19 14:28:50 +08:00
parent 51af761439
commit 18f541759f
+12 -1
View File
@@ -4,6 +4,14 @@
namespace Annotation; namespace Annotation;
use Exception;
use Snowflake\Snowflake;
/**
* Class Port
* @package Annotation
*/
#[\Attribute(\Attribute::TARGET_METHOD)] class Port extends Attribute #[\Attribute(\Attribute::TARGET_METHOD)] class Port extends Attribute
{ {
@@ -20,10 +28,13 @@ namespace Annotation;
/** /**
* @param array $handler * @param array $handler
* @return mixed * @return mixed
* @throws Exception
*/ */
public function execute(array $handler): mixed public function execute(array $handler): mixed
{ {
return parent::execute($handler); // TODO: Change the autogenerated stub $router = Snowflake::app()->getRouter();
$router->addPortListen($this->port, $handler);
return parent::execute($handler);
} }
} }