Skip to content

Commit

Permalink
调整名称空间use 位置
Browse files Browse the repository at this point in the history
  • Loading branch information
ndj888 committed Nov 30, 2017
1 parent fbd580a commit d687c20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/com_jjcbs/lib/annotation/Autowired.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ static protected function do()
$property->setAccessible(true);
$val = $property->getValue($obj);
if (empty($val)) return '';
static::useNamespace('com_jjcbs\\lib\\ServiceFactory');
static::useNamespace($val);
//check is service
$ref = new \ReflectionClass($val);
Expand All @@ -54,6 +53,7 @@ static protected function do()
PHP;
if ($parent = $ref->getParentClass()) {
if ( $parent->getName() == 'service'){
static::useNamespace('com_jjcbs\\lib\\ServiceFactory');
$tpl = <<<EOT
\$this->%s = ServiceFactory::getInstance(%s::class);
EOT;
Expand Down

0 comments on commit d687c20

Please sign in to comment.