Variable::export should export use short-hand array syntax so db-tools exports more standards compliant code

Created on 9 April 2018, about 6 years ago
Updated 10 February 2024, 4 months ago

Problem/Motivation

While the docblock in db tools says:

    // The template contains an instruction for the file to be ignored by PHPCS.
    // This is because the files can be huge and coding standards are
    // irrelevant.

There was a report of cs violations anyway: #2959514: Replace array() with [] to improve the coding standards. →

Can't see a reason why this should export short-hand array syntax.

Proposed resolution

Update this method to export short-hand arrays.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Other  →

Last updated about 3 hours ago

Created by

🇦🇺Australia Sam152

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India Nikhil_110

    Attached patch against drupal 10.1.x

  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States cilefen
  • 🇮🇳India TanujJain-TJ

    Reviewed #25 with drupal:10.1.x, the patch applied successfully attaching screenshot for reference. it replaced all array() with [ ]. RTBC +1

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    #15 still needs to happen.

    patch #25 is adding an additional change from the reroll

    -   *   A prefix that will be added at the beginning of every lines of the output.
    +   *   A prefix that will be added at the beginning of
    +   *   every lines of the output.
        *
    

    Failure is a legitimate one.

    @TanujJain-TJ thank you for looking but you don't need to provide a screenshot of the patch applying as that's shown by the CI build

  • 🇳🇿New Zealand quietone New Zealand

    Adding tag.

Production build 0.69.0 2024