Skip to content

Commit

Permalink
Merge pull request #3 from AiMuC/2.0
Browse files Browse the repository at this point in the history
兼容PHP8
  • Loading branch information
liu21st authored Jan 11, 2022
2 parents 8ae724d + f42cb77 commit 15c6d58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ protected function bindParams($reflect, array $vars = []): array
foreach ($params as $param) {
$name = $param->getName();
$lowerName = self::parseName($name);
$class = $param->getClass();
$reflectionType = $param->getType();

if ($class) {
$args[] = $this->getObjectParam($class->getName(), $vars);
if ($reflectionType && $reflectionType->isBuiltin() === false) {
$args[] = $this->getObjectParam($reflectionType->getName(), $vars);
} elseif (1 == $type && !empty($vars)) {
$args[] = array_shift($vars);
} elseif (0 == $type && isset($vars[$name])) {
Expand Down

0 comments on commit 15c6d58

Please sign in to comment.