diff options
author | Dogu <ydogu@wikimedia.org.tr> | 2024-01-02 19:31:56 +0100 |
---|---|---|
committer | Vikipolimer <ydogu@wikimedia.org.tr> | 2024-01-02 23:24:56 +0000 |
commit | bbc74d93b05e8522578551347a335f87f772d62d (patch) | |
tree | 1667f075cc2559c09a23f5811b9ef4fe216551bb /includes/widget/SpinnerWidget.php | |
parent | e5d24ccb9e654324dcab66e5d760cff45029a045 (diff) | |
download | mediawikicore-bbc74d93b05e8522578551347a335f87f772d62d.tar.gz mediawikicore-bbc74d93b05e8522578551347a335f87f772d62d.zip |
Refactor widget classes to use cleaner namespacing
This patch refactors various widget classes in the includes/widget
directory to use cleaner namespacing. The patches remove redundant backslash
prefixes in class extending statements and add use statements for OOUI classes
and other MediaWiki-specific classes. This patch improves readability and
maintainability of the code by following the MediaWiki coding conventions and
leverages the benefits of PHP's namespacing system.
List of affected classes:
- CheckMatrixWidget
- DateInputWidget
- DateTimeInputWidget
- NamespaceInputWidget
- SearchInputWidget
- SelectWithInputWidget
- SizeFilterWidget
- SpinnerWidget
- TagMultiselectWidget
- TitleInputWidget
- UserInputWidget
Additionally, the code now correctly documents exceptions thrown by
constructors where missing, enforcing clearer developer expectations.
Change-Id: I0fdaf68a412a1c3b7049a79222f4dbeaa95a6bbc
Diffstat (limited to 'includes/widget/SpinnerWidget.php')
-rw-r--r-- | includes/widget/SpinnerWidget.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/widget/SpinnerWidget.php b/includes/widget/SpinnerWidget.php index 71f26f7521af..4fa3887ae78e 100644 --- a/includes/widget/SpinnerWidget.php +++ b/includes/widget/SpinnerWidget.php @@ -2,6 +2,9 @@ namespace MediaWiki\Widget; +use Exception; +use MediaWiki\Html\Html; + /** * PHP version of jquery.spinner. * @@ -47,7 +50,7 @@ class SpinnerWidget { * @return string HTML serialization */ public function toString() { - return \MediaWiki\Html\Html::rawElement( 'div', $this->attributes, $this->content ); + return Html::rawElement( 'div', $this->attributes, $this->content ); } /** @@ -60,7 +63,7 @@ class SpinnerWidget { public function __toString() { try { return $this->toString(); - } catch ( \Exception $ex ) { + } catch ( Exception $ex ) { trigger_error( (string)$ex, E_USER_ERROR ); } } |