Merge pull request #71 from diolektor/fix_config_to_array

Fixed a getting value from config through method toArray
This commit is contained in:
Exile 2016-02-14 03:26:00 +03:00
commit 90902119b6

View file

@ -69,4 +69,24 @@ class Config extends ZendConfig
return $value;
}
/**
* @inheritdoc
*/
public function toArray()
{
$array = [];
$data = $this->data;
/** @var self $value */
foreach ($data as $key => $value) {
if ($value instanceof self) {
$array[$key] = $value->toArray();
} else {
$array[$key] = $this->prepareValue($value);
}
}
return $array;
}
}