public static function configure($object, iterable $config)
    {
        foreach ($config as $action => $arguments) {
            if (substr($action, -2) === '()') {
                // method call
                \call_user_func_array([$object, substr($action, 0, -2)], $arguments);
            } else {
                // property
                $object->$action = $arguments;
            }
        }

        return $object;
    }
public static function configure($object, iterable $config)
    {
        foreach ($config as $action => $arguments) {
            if (substr($action, -2) === '()') {
                // method call
                \call_user_func_array([$object, substr($action, 0, -2)], $arguments);
            } else {
                // property
                $object->$action = $arguments;
            }
        }

        return $object;
    }
public static function configure ( $ object , iterable $ config ) { foreach ( $ config as $ action => $ arguments ) { if ( substr ( $ action , - 2 ) === '()' ) { // method call \ call_user_func_array ( [ $ object , substr ( $ action , 0 , - 2 ) ] , $ arguments ) ; } else { // property $ object -> $ action = $ arguments ; } } return $ object ; }
Configures an object with the given configuration.
@deprecated Not recommended for explicit use. Added only to support Yii 2.0 behavior.
@param object $object the object to be configured
@param iterable $config property values and methods to call
@return object the object itself
Configures an object with the given configuration .