Skip to content

Commit e25f51e

Browse files
committed
- refactor: removes the nullable for reflector instance and assigning NULL on destruct
- chore: updated phpdoc
1 parent d95098f commit e25f51e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

DIContainer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class DIContainer implements DIContainerInterface
6666
public const EXCLUDE = 'exclude';
6767
public const NAMED = 'named';
6868

69-
protected ?DIReflector $reflection;
69+
protected DIReflector $reflection;
7070
private array $inProgress = [];
7171

7272
private array $singletons = [];
@@ -91,13 +91,15 @@ public function __clone()
9191

9292
public function __destruct()
9393
{
94-
$this->reflection = null;
9594
$this->singletons = [];
9695
$this->bindings = [];
9796
$this->exclude = [];
9897
$this->named = [];
9998
}
10099

100+
/**
101+
* @throws \ReflectionException
102+
*/
101103
public function __invoke(callable $callable, array $arguments = [])
102104
{
103105
return \call_user_func_array($callable, $this->reflection->processMethodArguments(

0 commit comments

Comments
 (0)