[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Move classes to own files

2017-12-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398635 )

Change subject: Move classes to own files
..


Move classes to own files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I358bc50deee92964cdc25d1912708cfa2f5cc081
---
M .phpcs.xml
M Collection.php
R CollectionProposals.php
A CollectionSuggest.php
A rendering/CollectionAPIResult.php
R rendering/CollectionRenderingAPI.php
A rendering/MWServeRenderingAPI.php
7 files changed, 336 insertions(+), 316 deletions(-)

Approvals:
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.phpcs.xml b/.phpcs.xml
index 10a4c41..1d566f2 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -6,7 +6,6 @@



-   



diff --git a/Collection.php b/Collection.php
index 2f6f21a..3e60c5e 100644
--- a/Collection.php
+++ b/Collection.php
@@ -180,8 +180,8 @@
 $wgAutoloadClasses['SpecialCollection'] = __DIR__ . '/Collection.body.php';
 $wgAutoloadClasses['CollectionSession'] = __DIR__ . '/Collection.session.php';
 $wgAutoloadClasses['CollectionHooks'] = __DIR__ . '/Collection.hooks.php';
-$wgAutoloadClasses['CollectionSuggest'] = __DIR__ . '/Collection.suggest.php';
-$wgAutoloadClasses['CollectionProposals'] = __DIR__ . 
'/Collection.suggest.php';
+$wgAutoloadClasses['CollectionSuggest'] = __DIR__ . '/CollectionSuggest.php';
+$wgAutoloadClasses['CollectionProposals'] = __DIR__ . 
'/CollectionProposals.php';
 
 $wgAutoloadClasses['SpecialRenderBook'] = __DIR__ . '/SpecialRenderBook.php';
 $wgAutoloadClasses[\MediaWiki\Extensions\Collection\DataProvider::class]
@@ -214,9 +214,9 @@
 $wgAutoloadClasses['CollectionSuggestTemplate'] =
__DIR__ . '/templates/CollectionSuggestTemplate.php';
 
-$wgAutoloadClasses['CollectionRenderingAPI'] = __DIR__ . '/RenderingAPI.php';
-$wgAutoloadClasses['MWServeRenderingAPI'] = __DIR__ . '/RenderingAPI.php';
-$wgAutoloadClasses['CollectionAPIResult'] = __DIR__ . '/RenderingAPI.php';
+$wgAutoloadClasses['CollectionRenderingAPI'] = __DIR__ . 
'/rendering/CollectionRenderingAPI.php';
+$wgAutoloadClasses['MWServeRenderingAPI'] = __DIR__ . 
'/rendering/MWServeRenderingAPI.php';
+$wgAutoloadClasses['CollectionAPIResult'] = __DIR__ . 
'/rendering/CollectionAPIResult.php';
 
 $wgMessagesDirs['Collection'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['CollectionAlias'] = __DIR__ . 
'/Collection.alias.php';
diff --git a/Collection.suggest.php b/CollectionProposals.php
similarity index 62%
rename from Collection.suggest.php
rename to CollectionProposals.php
index 7d1e142..42d7d77 100644
--- a/Collection.suggest.php
+++ b/CollectionProposals.php
@@ -21,208 +21,6 @@
  */
 
 /**
- * Class: CollectionSuggest
- *
- * This class contains only static methods, so theres no need for a 
constructer.
- * When the page Special:Book/suggest/ is loaded the method run() is called.
- * Ajax calles refresh().
- * When clearing a book the method clear() should be called.
- */
-class CollectionSuggest {
-   /**
-* 
===
-* public methods
-* 
===
-*/
-
-   /**
-* Main entrypoint
-*
-* @param string $mode
-*'add' => add one title to the book.
-*'addAll' => Add a list of titles to the book.
-*'ban' => Ban a title from the proposals.
-*'unban' => Undo a ban.
-*'remove' => Remove a title from the book, and ban it.
-*'removeOnly' => Remove a title without banning it.
-* @param string|string[] $param Name of the article to be added, banned
-*or removed, or a list of article names to be added.
-*/
-   public static function run( $mode = '', $param = '' ) {
-   global $wgOut;
-
-   if ( !CollectionSession::hasSession() ) {
-   CollectionSession::startSession();
-   }
-
-   $template = self::getCollectionSuggestTemplate( $mode, $param );
-   $wgOut->setPageTitle( wfMessage( 'coll-suggest_title' ) );
-   $wgOut->addModules( 'ext.collection.suggest' );
-   $wgOut->addTemplate( $template );
-   }
-
-   /**
-* Entrypoint for Ajax
-*
-* @param string $mode
-*'add' => add one title to the book.
-*'addAll' => Add a list of titles to the book.
-*'ban' => Ban a title from the proposals.
-*'unban' => Undo a ban.
-*'remove' => Remove a title from the book, and ban it.
-*'removeOnly' => Remove a title without banning it.
-* @param string|string[] $param Name of 

[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Move classes to own files

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398635 )

Change subject: Move classes to own files
..

Move classes to own files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I358bc50deee92964cdc25d1912708cfa2f5cc081
---
M .phpcs.xml
M Collection.php
R CollectionProposals.php
A CollectionSuggest.php
A rendering/CollectionAPIResult.php
R rendering/CollectionRenderingAPI.php
A rendering/MWServeRenderingAPI.php
7 files changed, 336 insertions(+), 316 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection 
refs/changes/35/398635/1

diff --git a/.phpcs.xml b/.phpcs.xml
index 10a4c41..1d566f2 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -6,7 +6,6 @@



-   



diff --git a/Collection.php b/Collection.php
index 2f6f21a..3e60c5e 100644
--- a/Collection.php
+++ b/Collection.php
@@ -180,8 +180,8 @@
 $wgAutoloadClasses['SpecialCollection'] = __DIR__ . '/Collection.body.php';
 $wgAutoloadClasses['CollectionSession'] = __DIR__ . '/Collection.session.php';
 $wgAutoloadClasses['CollectionHooks'] = __DIR__ . '/Collection.hooks.php';
-$wgAutoloadClasses['CollectionSuggest'] = __DIR__ . '/Collection.suggest.php';
-$wgAutoloadClasses['CollectionProposals'] = __DIR__ . 
'/Collection.suggest.php';
+$wgAutoloadClasses['CollectionSuggest'] = __DIR__ . '/CollectionSuggest.php';
+$wgAutoloadClasses['CollectionProposals'] = __DIR__ . 
'/CollectionProposals.php';
 
 $wgAutoloadClasses['SpecialRenderBook'] = __DIR__ . '/SpecialRenderBook.php';
 $wgAutoloadClasses[\MediaWiki\Extensions\Collection\DataProvider::class]
@@ -214,9 +214,9 @@
 $wgAutoloadClasses['CollectionSuggestTemplate'] =
__DIR__ . '/templates/CollectionSuggestTemplate.php';
 
-$wgAutoloadClasses['CollectionRenderingAPI'] = __DIR__ . '/RenderingAPI.php';
-$wgAutoloadClasses['MWServeRenderingAPI'] = __DIR__ . '/RenderingAPI.php';
-$wgAutoloadClasses['CollectionAPIResult'] = __DIR__ . '/RenderingAPI.php';
+$wgAutoloadClasses['CollectionRenderingAPI'] = __DIR__ . 
'/rendering/CollectionRenderingAPI.php';
+$wgAutoloadClasses['MWServeRenderingAPI'] = __DIR__ . 
'/rendering/MWServeRenderingAPI.php';
+$wgAutoloadClasses['CollectionAPIResult'] = __DIR__ . 
'/rendering/CollectionAPIResult.php';
 
 $wgMessagesDirs['Collection'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['CollectionAlias'] = __DIR__ . 
'/Collection.alias.php';
diff --git a/Collection.suggest.php b/CollectionProposals.php
similarity index 62%
rename from Collection.suggest.php
rename to CollectionProposals.php
index 7d1e142..42d7d77 100644
--- a/Collection.suggest.php
+++ b/CollectionProposals.php
@@ -21,208 +21,6 @@
  */
 
 /**
- * Class: CollectionSuggest
- *
- * This class contains only static methods, so theres no need for a 
constructer.
- * When the page Special:Book/suggest/ is loaded the method run() is called.
- * Ajax calles refresh().
- * When clearing a book the method clear() should be called.
- */
-class CollectionSuggest {
-   /**
-* 
===
-* public methods
-* 
===
-*/
-
-   /**
-* Main entrypoint
-*
-* @param string $mode
-*'add' => add one title to the book.
-*'addAll' => Add a list of titles to the book.
-*'ban' => Ban a title from the proposals.
-*'unban' => Undo a ban.
-*'remove' => Remove a title from the book, and ban it.
-*'removeOnly' => Remove a title without banning it.
-* @param string|string[] $param Name of the article to be added, banned
-*or removed, or a list of article names to be added.
-*/
-   public static function run( $mode = '', $param = '' ) {
-   global $wgOut;
-
-   if ( !CollectionSession::hasSession() ) {
-   CollectionSession::startSession();
-   }
-
-   $template = self::getCollectionSuggestTemplate( $mode, $param );
-   $wgOut->setPageTitle( wfMessage( 'coll-suggest_title' ) );
-   $wgOut->addModules( 'ext.collection.suggest' );
-   $wgOut->addTemplate( $template );
-   }
-
-   /**
-* Entrypoint for Ajax
-*
-* @param string $mode
-*'add' => add one title to the book.
-*'addAll' => Add a list of titles to the book.
-*'ban' => Ban a title from the proposals.
-*'unban' => Undo a ban.
-*'remove' => Remove a title from the book, and ban it.
-*'removeOnly' => Remove a title without banning it.
-* @param string|string[] $param