From 4137a817bb58344e80c6b578e5eaebad399d5ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 18:01:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Annotation/Inject.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Annotation/Inject.php b/Annotation/Inject.php index 3914e83c..67e9787b 100644 --- a/Annotation/Inject.php +++ b/Annotation/Inject.php @@ -39,15 +39,15 @@ use Snowflake\Snowflake; { $injectValue = $this->parseInjectValue(); - /** @var ReflectionProperty $property */ - if ($property->isPrivate() || $property->isProtected()) { - $method = 'set' . ucfirst($property->getName()); + /** @var ReflectionProperty $handler[1] */ + if ($handler[1]->isPrivate() || $handler[1]->isProtected()) { + $method = 'set' . ucfirst($handler[1]->getName()); if (!method_exists($handler[0], $method)) { return false; } $handler[0]->$method($injectValue); } else { - $handler[0]->{$property->getName()} = $injectValue; + $handler[0]->{$handler[1]->getName()} = $injectValue; } return $handler[0]; }