This commit is contained in:
2023-03-30 20:39:00 +08:00
parent bfa39c3669
commit 5c9f92f955
6 changed files with 275 additions and 167 deletions
+10 -7
View File
@@ -5,6 +5,7 @@ namespace Database\Annotation;
use Attribute;
use Database\Base\Getter;
use Kiri\Annotation\AbstractAttribute;
@@ -14,8 +15,8 @@ use Kiri\Annotation\AbstractAttribute;
*/
#[Attribute(Attribute::TARGET_METHOD)] class Get extends AbstractAttribute
{
/**
* Get constructor.
* @param string $name
@@ -23,17 +24,19 @@ use Kiri\Annotation\AbstractAttribute;
public function __construct(public string $name)
{
}
/**
* @param mixed $class
* @param mixed|null $method
* @return bool
*/
public function execute(mixed $class, mixed $method = null): bool
public function execute(mixed $class, mixed $method = null): bool
{
$keys = \Kiri::getDi()->get(Getter::class);
$keys->write($this->name, $class, $method);
return true;
}
}