This commit is contained in:
2021-10-28 16:58:15 +08:00
parent 0da9dac2b8
commit b764cc64aa
2 changed files with 38 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Annotation;
use Kiri\Kiri;
#[\Attribute(\Attribute::TARGET_CLASS)] class Mapping extends Attribute
{
/**
* @param string $class
*/
public function __construct(public string $class)
{
}
/**
* @param mixed $class
* @param mixed|string $method
* @return mixed
*/
public function execute(mixed $class, mixed $method = ''): mixed
{
Kiri::getDi()->mapping($class, $this->class);
return parent::execute($class, $method);
}
}