Updating deprecated Unicode::strtolower() calls in Drupal 8
This covers only the most common use cases.
Note that in this case, we are removing a helper service now that we can rely on a standard PHP function.
We have a set of examples as part of the Drupal Rector
rector_examples module. See https://github.com/palantirnet/drupal-rector/tree/master/rector_examples.
Automating updates with Drupal Rector
Drupal Rector is an open source tool built using Rector which can help automate this deprecation as well as other common deprecations.
For more information, see https://github.com/palantirnet/drupal-rector.
What is covered by the rector
Drupal Rector currently replaces static calls to
\Drupal\Component\Utility\Unicode::strtolower() as shown above. This also works if the Unicode class is defined with a use statement.
Drupal provided a way to provide unicode support for processing strings for versions of PHP that did not have this functionality. Symfony now includes a polyfill to handle these unicode functions when they are not provided by your PHP version.
The Drupal change record for this deprecation is available at https://www.drupal.org/node/2850048.
Credits and thank yous
Thank you to Dan Montgomery for leading Drupal Rector development to support this deprecation.
Thank you to Palantir.net for sponsoring this development.