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;
    }