public static function configure($object, $properties)
    {
        foreach ($properties as $name => $value) {
            if (!property_exists($object, $name)) {
                throw new InvalidConfigException(sprintf('Property %s in class %s not found.', $name, \get_class($object)));
            }
            $object->$name = $value;
        }

        return $object;
    }
public static function configure($object, $properties)
    {
        foreach ($properties as $name => $value) {
            if (!property_exists($object, $name)) {
                throw new InvalidConfigException(sprintf('Property %s in class %s not found.', $name, \get_class($object)));
            }
            $object->$name = $value;
        }

        return $object;
    }
public static function configure ( $ object , $ properties ) { foreach ( $ properties as $ name => $ value ) { if ( ! property_exists ( $ object , $ name ) ) { throw new InvalidConfigException ( sprintf ( 'Property %s in class %s not found.' , $ name , \ get_class ( $ object ) ) ) ; } $ object -> $ name = $ value ; } return $ object ; }
Configures an object with the initial property values. Inspired by Yii2.
@see \yii\BaseYii::configure
@param object $object the object to be configured
@param array $properties the property initial values given in terms of
name-value pairs.
@return object the object itself
@throws InvalidConfigException
Configures an object with the initial property values . Inspired by Yii2 .