This commit is contained in:
2020-12-16 15:20:51 +08:00
parent 991c3f9145
commit c2b3f02bfc
7 changed files with 158 additions and 34 deletions
+9
View File
@@ -4,6 +4,8 @@
namespace Annotation\Route;
use Snowflake\Snowflake;
/**
* Class Limits
* @package Annotation\Route
@@ -15,9 +17,16 @@ namespace Annotation\Route;
/**
* Limits constructor.
* @param string|array $limits
* @throws
*/
public function __construct(public string|array $limits)
{
if (is_string($this->limits)) {
$this->limits = [$this->limits];
}
foreach ($this->limits as $key => $item) {
$this->limits[$key] = Snowflake::createObject($item);
}
}