1 | <?php |
||
5 | class Config |
||
6 | { |
||
7 | /** |
||
8 | * Configuration. |
||
9 | * |
||
10 | * @var \PragmaRX\Coollection\Package\Coollection |
||
11 | */ |
||
12 | protected $config; |
||
13 | |||
14 | /** |
||
15 | * Key prefix. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $prefix = ''; |
||
20 | |||
21 | /** |
||
22 | * Config constructor. |
||
23 | * |
||
24 | * @param array|null $config |
||
25 | */ |
||
26 | 34 | public function __construct($config = null) |
|
30 | |||
31 | /** |
||
32 | * @param $key |
||
33 | * @return \PragmaRX\Coollection\Package\Coollection |
||
34 | */ |
||
35 | 32 | public function get($key) |
|
39 | |||
40 | /** |
||
41 | * @param $config |
||
42 | */ |
||
43 | 34 | protected function initialize($config = []) |
|
53 | |||
54 | /** |
||
55 | * Load the config. |
||
56 | * |
||
57 | * @return Collection |
||
58 | */ |
||
59 | 34 | protected function loadConfig() |
|
65 | |||
66 | /** |
||
67 | * Redirect properties access to config's Coollection. |
||
68 | * |
||
69 | * @param $name |
||
70 | * @return mixed|static |
||
71 | */ |
||
72 | 34 | public function __get($name) |
|
76 | |||
77 | /** |
||
78 | * Redirect methods calls to config's Coollection. |
||
79 | * |
||
80 | * @param $name |
||
81 | * @param $arguments |
||
82 | * @return mixed |
||
83 | */ |
||
84 | public function __call($name, $arguments) |
||
88 | } |
||
89 |
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.