This commit is contained in:
2023-04-15 23:32:00 +08:00
parent 06e2b691bb
commit eebd01bcc5
9 changed files with 404 additions and 349 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Kiri\Di\Inject;
use Kiri\Di\Interface\InjectPropertyInterface;
#[\Attribute(\Attribute::TARGET_PROPERTY)]
class Config implements InjectPropertyInterface
{
/**
* @param string $key
*/
public function __construct(public string $key)
{
}
/**
* @param object $class
* @param string $property
* @return void
*/
public function dispatch(object $class, string $property): void
{
// TODO: Implement dispatch() method.
$class->{$property} = config($this->key);
}
}