1 | <?php |
||
10 | class Registry |
||
11 | { |
||
12 | /** |
||
13 | * @var array<DataProvider> |
||
14 | */ |
||
15 | private $providers = []; |
||
16 | |||
17 | /** |
||
18 | * Add a provider to the registry |
||
19 | * |
||
20 | * @param DataProvider $provider |
||
21 | * @param string $index |
||
22 | * @param string $type |
||
23 | */ |
||
24 | public function addProvider(DataProvider $provider, $index, $type) |
||
34 | |||
35 | /** |
||
36 | * Get providers for index and type |
||
37 | * |
||
38 | * @param string $index |
||
|
|||
39 | * @param string $type |
||
40 | * |
||
41 | * @return array<DataProvider> |
||
42 | */ |
||
43 | public function getProviders($index = null, $type = null) |
||
49 | |||
50 | private function filter($index, $type) |
||
59 | |||
60 | private function match($providerData, $index, $type) |
||
68 | |||
69 | private function mapProviders(array $providers) |
||
78 | } |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.