1 | <?php |
||
9 | class ContainerAwareCallback extends Callback |
||
10 | { |
||
11 | /** |
||
12 | * @var \Illuminate\Contracts\Container\Container |
||
13 | */ |
||
14 | protected $container; |
||
15 | |||
16 | /** |
||
17 | * @param array $specs Specification for the callback to be called |
||
18 | * @param mixed $callable Closure, callable or string that will be called if specifications pass |
||
19 | * @param \Illuminate\Contracts\Container\Container $container The service container that will be used to resolve the callable |
||
20 | */ |
||
21 | public function __construct(array $specs, $callable, ContainerInterface $container) |
||
27 | |||
28 | /** |
||
29 | * {@inheritDoc} |
||
30 | */ |
||
31 | public function call(TransitionEvent $event) |
||
44 | |||
45 | /** |
||
46 | * {@inheritDoc} |
||
47 | */ |
||
48 | protected function filterCallable($callable, TransitionEvent $event) |
||
62 | |||
63 | /** |
||
64 | * Determine if the given string is in Class@method syntax. |
||
65 | * |
||
66 | * @param mixed $callback |
||
67 | * @return bool |
||
68 | */ |
||
69 | protected function isCallableWithAtSign($callback) |
||
73 | } |
||
74 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.