| 1 | <?php |
||
| 6 | final class DependencyInjector |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var BuilderInterface |
||
| 10 | */ |
||
| 11 | private $builder; |
||
| 12 | |||
| 13 | public function __construct(BuilderInterface $builder) |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Executes a callable, building and injecting its dependencies |
||
| 20 | * |
||
| 21 | * @param string[]|callable $callable |
||
| 22 | * @param array $arguments |
||
| 23 | * |
||
| 24 | * @throws CanNotInstantiateDependenciesException |
||
| 25 | * |
||
| 26 | * @return mixed |
||
| 27 | */ |
||
| 28 | public function execute($callable, array $arguments = []) |
||
| 32 | } |
||
| 33 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: