From: Reedy Date: Sun, 14 Apr 2019 02:40:03 +0000 (+0100) Subject: Split HTMLFormElement.php into class per file X-Git-Tag: 1.34.0-rc.0~1982^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=a32b1b16ef2703bfbffbd66e866064ac31b51133 Split HTMLFormElement.php into class per file Change-Id: Ia8a35056fa6df5b81cda3e5bfcaac91d0b898d51 --- diff --git a/.phpcs.xml b/.phpcs.xml index 7037ea7fdc..52e23cb663 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -207,7 +207,6 @@ */includes/api/ApiErrorFormatter\.php */includes/compat/XMPReader\.php */includes/diff/DairikiDiff\.php - */includes/htmlform/HTMLFormElement\.php */includes/libs/filebackend/FileBackendStore\.php */includes/libs/filebackend/FSFileBackend\.php */includes/libs/filebackend/SwiftFileBackend\.php diff --git a/autoload.php b/autoload.php index be4a1de25c..d9e126822a 100644 --- a/autoload.php +++ b/autoload.php @@ -589,11 +589,11 @@ $wgAutoloadLocalClasses = [ 'HTMLFileCache' => __DIR__ . '/includes/cache/HTMLFileCache.php', 'HTMLFloatField' => __DIR__ . '/includes/htmlform/fields/HTMLFloatField.php', 'HTMLForm' => __DIR__ . '/includes/htmlform/HTMLForm.php', - 'HTMLFormActionFieldLayout' => __DIR__ . '/includes/htmlform/HTMLFormElement.php', + 'HTMLFormActionFieldLayout' => __DIR__ . '/includes/htmlform/HTMLFormActionFieldLayout.php', 'HTMLFormElement' => __DIR__ . '/includes/htmlform/HTMLFormElement.php', 'HTMLFormField' => __DIR__ . '/includes/htmlform/HTMLFormField.php', 'HTMLFormFieldCloner' => __DIR__ . '/includes/htmlform/fields/HTMLFormFieldCloner.php', - 'HTMLFormFieldLayout' => __DIR__ . '/includes/htmlform/HTMLFormElement.php', + 'HTMLFormFieldLayout' => __DIR__ . '/includes/htmlform/HTMLFormFieldLayout.php', 'HTMLFormFieldRequiredOptionsException' => __DIR__ . '/includes/htmlform/HTMLFormFieldRequiredOptionsException.php', 'HTMLFormFieldWithButton' => __DIR__ . '/includes/htmlform/fields/HTMLFormFieldWithButton.php', 'HTMLHiddenField' => __DIR__ . '/includes/htmlform/fields/HTMLHiddenField.php', diff --git a/includes/htmlform/HTMLFormActionFieldLayout.php b/includes/htmlform/HTMLFormActionFieldLayout.php new file mode 100644 index 0000000000..2c082245be --- /dev/null +++ b/includes/htmlform/HTMLFormActionFieldLayout.php @@ -0,0 +1,16 @@ +initializeHTMLFormElement( $config ); + } + + protected function getJavaScriptClassName() { + return 'mw.htmlform.ActionFieldLayout'; + } +} diff --git a/includes/htmlform/HTMLFormElement.php b/includes/htmlform/HTMLFormElement.php index fbef2651f6..b77c17e964 100644 --- a/includes/htmlform/HTMLFormElement.php +++ b/includes/htmlform/HTMLFormElement.php @@ -33,33 +33,3 @@ trait HTMLFormElement { } ); } } - -class HTMLFormFieldLayout extends OOUI\FieldLayout { - use HTMLFormElement; - - public function __construct( $fieldWidget, array $config = [] ) { - parent::__construct( $fieldWidget, $config ); - - // Traits - $this->initializeHTMLFormElement( $config ); - } - - protected function getJavaScriptClassName() { - return 'mw.htmlform.FieldLayout'; - } -} - -class HTMLFormActionFieldLayout extends OOUI\ActionFieldLayout { - use HTMLFormElement; - - public function __construct( $fieldWidget, $buttonWidget = false, array $config = [] ) { - parent::__construct( $fieldWidget, $buttonWidget, $config ); - - // Traits - $this->initializeHTMLFormElement( $config ); - } - - protected function getJavaScriptClassName() { - return 'mw.htmlform.ActionFieldLayout'; - } -} diff --git a/includes/htmlform/HTMLFormFieldLayout.php b/includes/htmlform/HTMLFormFieldLayout.php new file mode 100644 index 0000000000..ce93db266b --- /dev/null +++ b/includes/htmlform/HTMLFormFieldLayout.php @@ -0,0 +1,16 @@ +initializeHTMLFormElement( $config ); + } + + protected function getJavaScriptClassName() { + return 'mw.htmlform.FieldLayout'; + } +}