jenkins-bot has submitted this change and it was merged.
Change subject: Turn spaces into tabs
......................................................................
Turn spaces into tabs
MW coding standards say tabs.
Change-Id: I368f60265e9035e69a445e1ad152834acf78996b
---
M maintenance/FlowCreateTemplates.php
1 file changed, 67 insertions(+), 67 deletions(-)
Approvals:
Catrope: Looks good to me, approved
jenkins-bot: Verified
diff --git a/maintenance/FlowCreateTemplates.php
b/maintenance/FlowCreateTemplates.php
index fdea4b7..44fac0e 100644
--- a/maintenance/FlowCreateTemplates.php
+++ b/maintenance/FlowCreateTemplates.php
@@ -1,8 +1,8 @@
<?php
require_once ( getenv( 'MW_INSTALL_PATH' ) !== false
- ? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
- : dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
+ ? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
+ : dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
/**
* Creates Template:FlowMention, which is used to render mentions in Flow's
Visual Editor.
@@ -12,83 +12,83 @@
* @ingroup Maintenance
*/
class FlowCreateTemplates extends LoggedUpdateMaintenance {
- /**
- * Returns an array of templates to be created (= pages in NS_TEMPLATE)
- *
- * The key in the array is an i18n message so the template titles can be
- * internationalized and/or edited per wiki.
- * The value is a callback function that will only receive $title and is
- * expected to return the page content in wikitext.
- *
- * @return array [title i18n key => content callback]
- */
- protected function getTemplates() {
- return array(
- 'flow-ve-mention-template-title' => function( Title $title ) {
- // get "User:" namespace prefix in wiki language
- global $wgContLang;
- $namespaces = $wgContLang->getFormattedNamespaces();
+ /**
+ * Returns an array of templates to be created (= pages in NS_TEMPLATE)
+ *
+ * The key in the array is an i18n message so the template titles can be
+ * internationalized and/or edited per wiki.
+ * The value is a callback function that will only receive $title and is
+ * expected to return the page content in wikitext.
+ *
+ * @return array [title i18n key => content callback]
+ */
+ protected function getTemplates() {
+ return array(
+ 'flow-ve-mention-template-title' => function( Title
$title ) {
+ // get "User:" namespace prefix in wiki language
+ global $wgContLang;
+ $namespaces =
$wgContLang->getFormattedNamespaces();
- return '@[[' . $namespaces[NS_USER] .
':{{{1|Example}}}|{{{2|{{{1|Example}}}}}}]]';
- },
- );
- }
+ return '@[[' . $namespaces[NS_USER] .
':{{{1|Example}}}|{{{2|{{{1|Example}}}}}}]]';
+ },
+ );
+ }
- public function __construct() {
- parent::__construct();
+ public function __construct() {
+ parent::__construct();
- $this->mDescription = "Creates Template:FlowMention, which is used te
render mentions in Flow's Visual Editor";
- }
+ $this->mDescription = "Creates Template:FlowMention, which is
used te render mentions in Flow's Visual Editor";
+ }
- protected function getUpdateKey() {
- $templates = $this->getTemplates();
- $keys = array_keys( $templates );
- sort( $keys );
+ protected function getUpdateKey() {
+ $templates = $this->getTemplates();
+ $keys = array_keys( $templates );
+ sort( $keys );
- // make the updatekey unique for the i18n keys of the pages to be
created
- // so we can easily skip this update if there are no changes
- return __CLASS__ . ':' . md5( implode( ',', $keys ) );
- }
+ // make the updatekey unique for the i18n keys of the pages to
be created
+ // so we can easily skip this update if there are no changes
+ return __CLASS__ . ':' . md5( implode( ',', $keys ) );
+ }
- protected function doDBUpdates() {
- $status = Status::newGood();
+ protected function doDBUpdates() {
+ $status = Status::newGood();
- $templates = $this->getTemplates();
- foreach ( $templates as $key => $callback ) {
- $title = Title::newFromText( wfMessage( $key
)->inContentLanguage()->plain(), NS_TEMPLATE );
- $content = new WikitextContent( $callback( $title ) );
+ $templates = $this->getTemplates();
+ foreach ( $templates as $key => $callback ) {
+ $title = Title::newFromText( wfMessage( $key
)->inContentLanguage()->plain(), NS_TEMPLATE );
+ $content = new WikitextContent( $callback( $title ) );
- $status->merge( $this->create( $title, $content ) );
- }
+ $status->merge( $this->create( $title, $content ) );
+ }
- return $status->isOK();
- }
+ return $status->isOK();
+ }
- /**
- * Creates a page with the given content (unless it already exists)
- *
- * @param Title $title
- * @param WikitextContent $content
- * @return Status
- * @throws MWException
- */
- protected function create( Title $title, WikitextContent $content ) {
- $article = new Article( $title );
- $page = $article->getPage();
+ /**
+ * Creates a page with the given content (unless it already exists)
+ *
+ * @param Title $title
+ * @param WikitextContent $content
+ * @return Status
+ * @throws MWException
+ */
+ protected function create( Title $title, WikitextContent $content ) {
+ $article = new Article( $title );
+ $page = $article->getPage();
- if ( $page->getRevision() !== null ) {
- // template already exists, don't overwrite it
- return Status::newGood();
- }
+ if ( $page->getRevision() !== null ) {
+ // template already exists, don't overwrite it
+ return Status::newGood();
+ }
- return $page->doEditContent(
- $content,
- '/* Automatically created by Flow */',
- EDIT_FORCE_BOT | EDIT_SUPPRESS_RC,
- false,
- FlowHooks::getOccupationController()->getTalkpageManager()
- );
- }
+ return $page->doEditContent(
+ $content,
+ '/* Automatically created by Flow */',
+ EDIT_FORCE_BOT | EDIT_SUPPRESS_RC,
+ false,
+
FlowHooks::getOccupationController()->getTalkpageManager()
+ );
+ }
}
$maintClass = 'FlowCreateTemplates';
--
To view, visit https://gerrit.wikimedia.org/r/232488
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I368f60265e9035e69a445e1ad152834acf78996b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits