1 | <?php |
||
18 | class CallbackDictionary extends SimpleDictionary |
||
19 | { |
||
20 | /** |
||
21 | * @var array|\Closure[] |
||
22 | */ |
||
23 | private $callbacks = []; |
||
24 | |||
25 | /** |
||
26 | * @param \Closure $then |
||
27 | */ |
||
28 | public function onTypeNotFound(\Closure $then): void |
||
32 | |||
33 | /** |
||
34 | * @param string $name |
||
35 | * @param Definition|null $from |
||
36 | * @return TypeDefinition |
||
37 | * @throws \Railt\Reflection\Exception\TypeNotFoundException |
||
38 | */ |
||
39 | public function get(string $name, Definition $from = null): TypeDefinition |
||
45 | |||
46 | /** |
||
47 | * @param string $name |
||
48 | * @param TypeDefinition|null $from |
||
49 | */ |
||
50 | private function invoke(string $name, TypeDefinition $from = null): void |
||
60 | |||
61 | /** |
||
62 | * @param string $name |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function has(string $name): bool |
||
71 | |||
72 | /** |
||
73 | * @param string $name |
||
74 | * @return null|TypeDefinition |
||
75 | */ |
||
76 | public function find(string $name): ?TypeDefinition |
||
82 | } |
||
83 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.