Problem/Motivation

In the 8.x branch, code is quoted inconsistently.

Per the docs on quoting standards:

Quotes

Drupal does not have a hard standard for the use of single quotes vs. double quotes. Where possible, keep consistency within each module, and respect the personal style of other developers.

With that caveat in mind, single quote strings should be used by default. Their use is recommended except in two cases:

Deliberate in-line variable interpolation, e.g. "(h2)$header(/h2)".
Translated strings where one can avoid escaping single quotes by enclosing the string in double quotes. One such string would be "He's a good person." It would be 'He\'s a good person.' with single quotes. Such escaping may not be handled properly by .pot file generators for text translation, and it's also somewhat awkward to read.

Proposed resolution

Updating quoting to consistent standards.

Comments

JacobSanford created an issue. See original summary.

JacobSanford’s picture

Original credit to @msankhala in #2960831: Migrate from drupal_set_message()

JacobSanford’s picture

Title: Use of quotation marks in code is not consistent. » Use of quotation marks is not consistent.