Merge pull request #10862 from frederic34/patch-5

phpcs fix
This commit is contained in:
Laurent Destailleur 2019-03-18 08:54:27 +01:00 committed by GitHub
commit e93b3a2d3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,8 +54,8 @@ class DolConfigCollector extends ConfigCollector
$config = array(
'Dolibarr' => array(
'const' => $const['user'],
'$conf' => $this->object_to_array($conf),
'$user' => $this->object_to_array($user)
'$conf' => $this->objectToArray($conf),
'$user' => $this->objectToArray($user)
),
'PHP' => array(
'version' => PHP_VERSION,
@ -74,12 +74,12 @@ class DolConfigCollector extends ConfigCollector
* @param mixed $obj Object
* @return array Array
*/
protected function object_to_array($obj)
protected function objectToArray($obj)
{
// phpcs:enable
$_arr = is_object($obj) ? get_object_vars($obj) : $obj;
foreach ($_arr as $key => $val) {
$val = (is_array($val) || is_object($val)) ? $this->object_to_array($val) : $val;
$val = (is_array($val) || is_object($val)) ? $this->objectToArray($val) : $val;
$arr[$key] = $val;
}