Compare commits

...

1 Commits

Author SHA1 Message Date
as2252258 f46af653f2 1 2022-01-09 14:33:33 +08:00
3 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ use JetBrains\PhpStorm\Pure;
use Kiri\Abstracts\Config;
use Kiri\Application;
use Kiri\Core\ArrayAccess;
use Kiri\Di\AnnotationManager;
use Kiri\Di\NoteManager;
use Kiri\Error\Logger;
use Kiri\Events\EventDispatch;
use Kiri\Events\EventProvider;
@@ -261,7 +261,7 @@ if (!function_exists('injectRuntime')) {
$router = [];
foreach ($fileLists as $class) {
foreach (AnnotationManager::getTargetAnnotation($class) as $value) {
foreach (NoteManager::getTargetAnnotation($class) as $value) {
if (!method_exists($value, 'execute')) {
continue;
}
+5 -5
View File
@@ -197,7 +197,7 @@ class Container implements ContainerInterface
*/
public function propertyInject(ReflectionClass $reflect, $object): mixed
{
foreach (AnnotationManager::getPropertyAnnotation($reflect) as $property => $inject) {
foreach (NoteManager::getPropertyAnnotation($reflect) as $property => $inject) {
/** @var Inject $inject */
$inject->execute($object, $property);
}
@@ -212,7 +212,7 @@ class Container implements ContainerInterface
*/
public function getMethodAttribute($className, $method = null): array
{
$methods = AnnotationManager::getMethodAnnotation($this->getReflect($className));
$methods = NoteManager::getMethodAnnotation($this->getReflect($className));
if (!empty($method)) {
return $methods[$method] ?? [];
}
@@ -227,7 +227,7 @@ class Container implements ContainerInterface
*/
public function getClassReflectionProperty(string $class, string $property = null): ReflectionProperty|null|array
{
$lists = AnnotationManager::getProperty($this->getReflect($class));
$lists = NoteManager::getProperty($this->getReflect($class));
if (empty($lists)) {
return null;
}
@@ -266,7 +266,7 @@ class Container implements ContainerInterface
if ($reflect->isAbstract() || $reflect->isTrait() || $reflect->isInterface()) {
return $this->_reflection[$class] = $reflect;
}
$construct = AnnotationManager::resolveTarget($reflect);
$construct = NoteManager::resolveTarget($reflect);
if (!empty($construct) && $construct->getNumberOfParameters() > 0) {
$this->_constructs[$class] = $construct;
}
@@ -284,7 +284,7 @@ class Container implements ContainerInterface
if (is_string($class)) {
$class = $this->getReflect($class);
}
return AnnotationManager::getMethods($class);
return NoteManager::getMethods($class);
}
+4 -4
View File
@@ -7,7 +7,7 @@ use ReflectionAttribute;
use ReflectionClass;
use ReflectionProperty;
class AnnotationManager
class NoteManager
{
@@ -171,9 +171,9 @@ class AnnotationManager
*/
public static function resolveTarget(ReflectionClass $reflect): ?\ReflectionMethod
{
AnnotationManager::setPropertyAnnotation($reflect);
AnnotationManager::setTargetAnnotation($reflect);
AnnotationManager::setMethodAnnotation($reflect);
NoteManager::setPropertyAnnotation($reflect);
NoteManager::setTargetAnnotation($reflect);
NoteManager::setMethodAnnotation($reflect);
return $reflect->getConstructor();
}