From 870dbf06596a22a973b2900eee605b0d886a8ba2 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Sat, 26 Sep 2015 21:19:00 +0300 Subject: [PATCH] Make lines short to pass phpcs in six files under includes/ Bug: T102614 Change-Id: I91a2d4f4bf86a22c8bb466da0e2f95ea27c571a3 --- includes/Sanitizer.php | 4 ++- includes/title/MalformedTitleException.php | 4 ++- includes/utils/BatchRowUpdate.php | 4 ++- .../widget/ComplexNamespaceInputWidget.php | 33 ++++++++++++------- includes/widget/ComplexTitleInputWidget.php | 11 ++++--- includes/widget/TitleInputWidget.php | 7 ++-- 6 files changed, 42 insertions(+), 21 deletions(-) diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index de63af7979..3e07b045c4 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -1807,7 +1807,9 @@ class Sanitizer { $host = preg_replace( $strip, '', $host ); // IPv6 host names are bracketed with []. Url-decode these. - if ( substr_compare( "//%5B", $host, 0, 5 ) === 0 && preg_match( '!^//%5B([0-9A-Fa-f:.]+)%5D((:\d+)?)$!', $host, $matches ) ) { + if ( substr_compare( "//%5B", $host, 0, 5 ) === 0 && + preg_match( '!^//%5B([0-9A-Fa-f:.]+)%5D((:\d+)?)$!', $host, $matches ) + ) { $host = '//[' . $matches[1] . ']' . $matches[2]; } diff --git a/includes/title/MalformedTitleException.php b/includes/title/MalformedTitleException.php index 0892ce4e57..5b8b643062 100644 --- a/includes/title/MalformedTitleException.php +++ b/includes/title/MalformedTitleException.php @@ -33,7 +33,9 @@ class MalformedTitleException extends Exception { * @param string[] $errorMessageParameters Additional parameters for the error message. * $titleText will be appended if it's not null. (since MW 1.26) */ - public function __construct( $errorMessage = null, $titleText = null, $errorMessageParameters = array() ) { + public function __construct( + $errorMessage = null, $titleText = null, $errorMessageParameters = array() + ) { $this->errorMessage = $errorMessage; $this->titleText = $titleText; if ( $titleText !== null ) { diff --git a/includes/utils/BatchRowUpdate.php b/includes/utils/BatchRowUpdate.php index a4257a5346..e739be3478 100644 --- a/includes/utils/BatchRowUpdate.php +++ b/includes/utils/BatchRowUpdate.php @@ -71,7 +71,9 @@ class BatchRowUpdate { * @param RowUpdateGenerator $generator Generates single row updates * based on the rows content */ - public function __construct( BatchRowIterator $reader, BatchRowWriter $writer, RowUpdateGenerator $generator ) { + public function __construct( + BatchRowIterator $reader, BatchRowWriter $writer, RowUpdateGenerator $generator + ) { $this->reader = $reader; $this->writer = $writer; $this->generator = $generator; diff --git a/includes/widget/ComplexNamespaceInputWidget.php b/includes/widget/ComplexNamespaceInputWidget.php index 21c57099fb..dc95e75ef6 100644 --- a/includes/widget/ComplexNamespaceInputWidget.php +++ b/includes/widget/ComplexNamespaceInputWidget.php @@ -22,19 +22,19 @@ class ComplexNamespaceInputWidget extends \OOUI\Widget { /** * @param array $config Configuration options - * @param array $config['namespace'] Configuration for the NamespaceInputWidget dropdown with list - * of namespaces - * @param string $config['namespace']['includeAllValue'] If specified, add a "all namespaces" - * option to the dropdown, and use this as the input value for it - * @param array|null $config['invert'] Configuration for the "invert selection" CheckboxInputWidget. If - * null, the checkbox will not be generated. + * @param array $config['namespace'] Configuration for the NamespaceInputWidget + * dropdown with list of namespaces + * @param string $config['namespace']['includeAllValue'] If specified, + * add an "all namespaces" option to the dropdown, and use this as the input value for it + * @param array|null $config['invert'] Configuration for the "invert selection" + * CheckboxInputWidget. If null, the checkbox will not be generated. * @param array|null $config['associated'] Configuration for the "include associated namespace" - * CheckboxInputWidget. If null, the checkbox will not be generated. - * @param array $config['invertLabel'] Configuration for the FieldLayout with label wrapping the - * "invert selection" checkbox + * CheckboxInputWidget. If null, the checkbox will not be generated. + * @param array $config['invertLabel'] Configuration for the FieldLayout with label + * wrapping the "invert selection" checkbox * @param string $config['invertLabel']['label'] Label text for the label - * @param array $config['associatedLabel'] Configuration for the FieldLayout with label wrapping - * the "include associated namespace" checkbox + * @param array $config['associatedLabel'] Configuration for the FieldLayout with label + * wrapping the "include associated namespace" checkbox * @param string $config['associatedLabel']['label'] Label text for the label */ public function __construct( array $config = array() ) { @@ -102,7 +102,16 @@ class ComplexNamespaceInputWidget extends \OOUI\Widget { $config, array_intersect_key( $this->config, - array_fill_keys( array( 'namespace', 'invert', 'invertLabel', 'associated', 'associatedLabel' ), true ) + array_fill_keys( + array( + 'namespace', + 'invert', + 'invertLabel', + 'associated', + 'associatedLabel' + ), + true + ) ) ); return parent::getConfig( $config ); diff --git a/includes/widget/ComplexTitleInputWidget.php b/includes/widget/ComplexTitleInputWidget.php index 73ef54c848..ea0ef9e293 100644 --- a/includes/widget/ComplexTitleInputWidget.php +++ b/includes/widget/ComplexTitleInputWidget.php @@ -19,8 +19,8 @@ class ComplexTitleInputWidget extends \OOUI\Widget { * Like TitleInputWidget, but the namespace has to be input through a separate dropdown field. * * @param array $config Configuration options - * @param array $config['namespace'] Configuration for the NamespaceInputWidget dropdown with list - * of namespaces + * @param array $config['namespace'] Configuration for the NamespaceInputWidget dropdown + * with list of namespaces * @param array $config['title'] Configuration for the TitleInputWidget text field */ public function __construct( array $config = array() ) { @@ -42,10 +42,13 @@ class ComplexTitleInputWidget extends \OOUI\Widget { $this->title = new TitleInputWidget( array_merge( $config['title'], array( - // The inner TitleInputWidget shouldn't be infusable, only the ComplexTitleInputWidget itself can be. + // The inner TitleInputWidget shouldn't be infusable, + // only the ComplexTitleInputWidget itself can be. 'infusable' => false, 'relative' => true, - 'namespace' => isset( $config['namespace']['value'] ) ? $config['namespace']['value'] : null, + 'namespace' => isset( $config['namespace']['value'] ) ? + $config['namespace']['value'] : + null, ) ) ); diff --git a/includes/widget/TitleInputWidget.php b/includes/widget/TitleInputWidget.php index 8ac7014eb8..5550a21553 100644 --- a/includes/widget/TitleInputWidget.php +++ b/includes/widget/TitleInputWidget.php @@ -19,12 +19,15 @@ class TitleInputWidget extends \OOUI\TextInputWidget { /** * @param array $config Configuration options * @param int|null $config['namespace'] Namespace to prepend to queries - * @param bool|null $config['relative'] If a namespace is set, return a title relative to it (default: true) + * @param bool|null $config['relative'] If a namespace is set, + * return a title relative to it (default: true) * @param bool|null $config['suggestions'] Display search suggestions (default: true) */ public function __construct( array $config = array() ) { // Parent constructor - parent::__construct( array_merge( array( 'infusable' => true, 'maxLength' => 255 ), $config ) ); + parent::__construct( + array_merge( array( 'infusable' => true, 'maxLength' => 255 ), $config ) + ); // Properties, which are ignored in PHP and just shipped back to JS if ( isset( $config['namespace'] ) ) { -- 2.20.1