The change originally made in #1653026: [META] Use properly typed values in module configuration made configuration files use proper typed values, so if you saved an integer, it stayed being an integer when read back. Read more about that at https://drupal.org/node/2153569
However, when configuration is saved from a form, form data comes mostly as strings (as inherent in PHP / web forms). To ensure the right types are used so changes from 1 to '1' and vice versa re not made to the configuration, we wanted to make sure types are properly used. We already have a configuration schema system to describe those types, so we introduced use of those schemas to cast the values to their proper values on saving configuration.
// Explicitly passing then number as a string.
$items_limit = '10';
\Drupal::config('system.rss')->set('items.limit', $items_limit)->save();
var_dump(\Drupal::config('system.rss')->get('items.limit'));
Before this change this would output (keeping the data type as provided in the value):
string(2) "10"
After this change it outputs (casting the data type to the one provided in the schema for system.rss):
int(10)
The schema snippet relevant for this type cast is in modules/system/config/schema/system.schema.yml:
system.rss:
type: mapping
label: 'Feed settings'
mapping:
channel:
type: mapping
label: 'Feed channel'
mapping:
description:
type: text
label: 'Feed description'
items:
type: mapping
label: 'Feed items'
mapping:
limit:
type: integer
label: 'Feed item limit'
view_mode:
type: string
label: 'Feed content'
langcode:
type: string
label: 'Default language'
Note that the limit key of the items key is typed as an integer.
Read more about configuration schema, the types available and how to write schema files at https://drupal.org/node/1905070.
The configuration schema remains optional, but it is suggested you provide configuration schema for easier configuration management (and other benefits).