parseInjectValue(); /** @var ReflectionProperty $property */ if ($property->isPrivate() || $property->isProtected()) { $method = 'set' . ucfirst($property->getName()); if (!method_exists($handler[0], $method)) { return false; } $handler[0]->$method($injectValue); } else { $handler[0]->{$property->getName()} = $injectValue; } return $handler[0]; } /** * @return mixed * @throws ComponentException * @throws NotFindClassException * @throws ReflectionException */ private function parseInjectValue(): mixed { if (class_exists($this->className)) { $injectValue = Snowflake::createObject($this->className, $this->args); } else if (Snowflake::app()->has($this->className)) { $injectValue = Snowflake::app()->get($this->className); } else { $injectValue = $this->className; } if (!empty($this->args) && is_object($injectValue)) { Snowflake::configure($injectValue, $this->args); } return $injectValue; } }