mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@42249 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2248,6 +2248,7 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
*/
|
||||
|
||||
// Extract type, name and columns from the definition.
|
||||
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
|
||||
preg_match(
|
||||
'/^'
|
||||
. '(?P<index_type>' // 1) Type of the index.
|
||||
@@ -2271,6 +2272,7 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
$fld,
|
||||
$index_matches
|
||||
);
|
||||
// phpcs:enable
|
||||
|
||||
// Uppercase the index type and normalize space characters.
|
||||
$index_type = strtoupper( preg_replace( '/\s+/', ' ', trim( $index_matches['index_type'] ) ) );
|
||||
|
||||
Reference in New Issue
Block a user