Make WordPress Core


Ignore:
Timestamp:
11/28/2017 04:23:11 AM (7 years ago)
Author:
pento
Message:

General: Add inline PHPCS options to leave regex indentation.

We have a handful of super long regexen that are written over multiple lines, as a collection of strings concatenated together. Each string is indented appropriately for the regex, but PHPCS doesn't recognised this, so defaults to removing the extra whitespace.

Disabling the Squiz.Strings.ConcatenationSpacing.PaddingFound rule for these blocks stops the extra whitespace from being removed.

See #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r42228 r42249  
    22492249
    22502250                    // Extract type, name and columns from the definition.
     2251                    // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
    22512252                    preg_match(
    22522253                        '/^'
     
    22722273                        $index_matches
    22732274                    );
     2275                    // phpcs:enable
    22742276
    22752277                    // Uppercase the index type and normalize space characters.
Note: See TracChangeset for help on using the changeset viewer.