I have a class in a vendor folder which have an array
private $mids = [
'a' =>'b',
'c' => 'd'
];
private $config = [
'sid' => null,
'aid' => null,
];
and a constructor which sets up private $config
function __construct($config){
foreach ($config as $key => $value) {
if (array_key_exists($key, $this->config)) {
$this->config[$key] = $value;
}
}
}
I want to update $mid with a new key/value 'x' => 'y' so i extended the class and copied the parent constructor to child constructor.
But when i try to call the functions which are defined in the parent i get the error that undefined $this->config($key). so the function is using the parent $config property instead of childs.
What am i doing wrong?
Or what is the best way to do this instead of editing the vendor source