Split HTMLFormElement.php into class per file
authorReedy <reedy@wikimedia.org>
Sun, 14 Apr 2019 02:40:03 +0000 (03:40 +0100)
committerReedy <reedy@wikimedia.org>
Sun, 14 Apr 2019 12:38:49 +0000 (13:38 +0100)
Change-Id: Ia8a35056fa6df5b81cda3e5bfcaac91d0b898d51

.phpcs.xml
autoload.php
includes/htmlform/HTMLFormActionFieldLayout.php [new file with mode: 0644]
includes/htmlform/HTMLFormElement.php
includes/htmlform/HTMLFormFieldLayout.php [new file with mode: 0644]

index 7037ea7..52e23cb 100644 (file)
                <exclude-pattern>*/includes/api/ApiErrorFormatter\.php</exclude-pattern>
                <exclude-pattern>*/includes/compat/XMPReader\.php</exclude-pattern>
                <exclude-pattern>*/includes/diff/DairikiDiff\.php</exclude-pattern>
-               <exclude-pattern>*/includes/htmlform/HTMLFormElement\.php</exclude-pattern>
                <exclude-pattern>*/includes/libs/filebackend/FileBackendStore\.php</exclude-pattern>
                <exclude-pattern>*/includes/libs/filebackend/FSFileBackend\.php</exclude-pattern>
                <exclude-pattern>*/includes/libs/filebackend/SwiftFileBackend\.php</exclude-pattern>
index be4a1de..d9e1268 100644 (file)
@@ -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 (file)
index 0000000..2c08224
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+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';
+       }
+}
index fbef265..b77c17e 100644 (file)
@@ -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 (file)
index 0000000..ce93db2
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+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';
+       }
+}