1 | <?php |
||
16 | class BaseDevCommand extends Command |
||
17 | { |
||
18 | /** |
||
19 | * @var string The location of the devconfig json where data is stored. |
||
20 | */ |
||
21 | public $configFile = '@appFolder/devconfig.json'; |
||
22 | |||
23 | /** |
||
24 | * Display config data and location. |
||
25 | * |
||
26 | * @return boolean|void |
||
27 | */ |
||
28 | public function actionConfigInfo() |
||
42 | |||
43 | /** |
||
44 | * Read entire config and return as array. |
||
45 | * |
||
46 | * @return array|boolean |
||
47 | */ |
||
48 | protected function readConfig() |
||
58 | |||
59 | /** |
||
60 | * Get a specific value for a given key. |
||
61 | * |
||
62 | * @param string $key |
||
63 | * @return boolean |
||
64 | */ |
||
65 | protected function getConfig($key) |
||
71 | |||
72 | /** |
||
73 | * Save a value in the config for a given key. |
||
74 | * |
||
75 | * @param string $key |
||
76 | * @param mixed $value |
||
77 | * @return mixed |
||
78 | */ |
||
79 | protected function saveConfig($key, $value) |
||
97 | } |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.