Skip to content

Commit

Permalink
Merge pull request #854 from semsphy/getclass-is-deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
irazasyed authored Jun 7, 2021
2 parents 439552e + f731453 commit 90ba433
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Answers/AnswerBus.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ protected function buildDependencyInjectedAnswer($answerClass)
$container = $this->telegram->getContainer();
$dependencies = [];
foreach ($params as $param) {
$dependencies[] = $container->make($param->getClass()->name);
if (version_compare(PHP_VERSION, '8.0.0') >= 0) {

This comment has been minimized.

Copy link
@korkoshko

korkoshko Aug 14, 2021

Contributor

IMHO, using the getClass method for older PHP versions is pointless. The getType method in the current form has been present since PHP 7.1.

$dependencies[] = $container->make($param->getType()->getName());
}
else{
$dependencies[] = $container-make($param->getClass()->name);
}
}

// and instantiate the object with dependencies through ReflectionClass
Expand Down

0 comments on commit 90ba433

Please sign in to comment.