[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Move Contributions and ChangesList hook handlers to their de...

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

Change subject: Move Contributions and ChangesList hook handlers to their 
dedicated files
..


Move Contributions and ChangesList hook handlers to their dedicated files

It's just moving the code around and makes the Hook class bearably clean

Change-Id: I35247553444d595330f149c6c5b1f29165ee1e40
---
M extension.json
M includes/Hooks.php
A includes/Hooks/ChangesListHooksHandler.php
A includes/Hooks/ContributionsHooksHandler.php
A tests/phpunit/includes/Hooks/ChangesListHooksHandlerTest.php
A tests/phpunit/includes/Hooks/ContributionsHookHandlerTest.php
M tests/phpunit/includes/HooksTest.php
7 files changed, 1,339 insertions(+), 1,223 deletions(-)

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



diff --git a/extension.json b/extension.json
index c3ce04a..63f226b 100644
--- a/extension.json
+++ b/extension.json
@@ -13,6 +13,8 @@
"ORES\\Cache": "includes/Cache.php",
"ORES\\Hooks": "includes/Hooks.php",
"ORES\\Hooks\\ApiHooksHandler": 
"includes/Hooks/ApiHooksHandler.php",
+   "ORES\\Hooks\\ChangesListHooksHandler": 
"includes/Hooks/ChangesListHooksHandler.php",
+   "ORES\\Hooks\\ContributionsHooksHandler": 
"includes/Hooks/ContributionsHooksHandler.php",
"ORES\\Hooks\\PreferencesHookHandler": 
"includes/Hooks/PreferencesHookHandler.php",
"ORES\\FetchScoreJob": "includes/FetchScoreJob.php",
"ORES\\Range": "includes/Range.php",
@@ -50,19 +52,19 @@
"ORES\\Hooks::onBeforePageDisplay"
],
"ChangesListSpecialPageStructuredFilters": [
-   "ORES\\Hooks::onChangesListSpecialPageStructuredFilters"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onChangesListSpecialPageStructuredFilters"
],
"ChangesListSpecialPageQuery": [
-   "ORES\\Hooks::onChangesListSpecialPageQuery"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onChangesListSpecialPageQuery"
],
"ContribsPager::getQueryInfo": [
-   "ORES\\Hooks::onContribsGetQueryInfo"
+   
"ORES\\Hooks\\ContributionsHooksHandler::onContribsGetQueryInfo"
],
"EnhancedChangesListModifyBlockLineData": [
-   "ORES\\Hooks::onEnhancedChangesListModifyBlockLineData"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onEnhancedChangesListModifyBlockLineData"
],
"EnhancedChangesListModifyLineData": [
-   "ORES\\Hooks::onEnhancedChangesListModifyLineData"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onEnhancedChangesListModifyLineData"
],
"GetBetaFeaturePreferences": [
"ORES\\Hooks::onGetBetaFeaturePreferences"
@@ -74,7 +76,7 @@
"ORES\\Hooks::onLoadExtensionSchemaUpdates"
],
"OldChangesListRecentChangesLine": [
-   "ORES\\Hooks::onOldChangesListRecentChangesLine"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onOldChangesListRecentChangesLine"
],
"RecentChange_save": [
"ORES\\Hooks::onRecentChange_save"
@@ -83,13 +85,13 @@
"ORES\\Hooks::onRecentChangesPurgeRows"
],
"SpecialContributions::formatRow::flags": [
-   "ORES\\Hooks::onSpecialContributionsFormatRowFlags"
+   
"ORES\\Hooks\\ContributionsHooksHandler::onSpecialContributionsFormatRowFlags"
],
"ContributionsLineEnding": [
-   "ORES\\Hooks::onContributionsLineEnding"
+   
"ORES\\Hooks\\ContributionsHooksHandler::onContributionsLineEnding"
],
"SpecialContributions::getForm::filters": [
-   "ORES\\Hooks::onSpecialContributionsGetFormFilters"
+   
"ORES\\Hooks\\ContributionsHooksHandler::onSpecialContributionsGetFormFilters"
]
},
"ResourceFileModulePaths": {
diff --git a/includes/Hooks.php b/includes/Hooks.php
index b0d53aa..78c71c3 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -3,29 +3,18 @@
 namespace ORES;
 
 use BetaFeatures;
-use ChangesList;
-use ChangesListBooleanFilterGroup;
-use ChangesListSpecialPage;
-use ChangesListStringOptionsFilterGroup;
-use ContribsPager;
 use DatabaseUpdater;
-use EnhancedChangesList;
 use Exception;
-use FormOptions;
 use JobQueueGroup;
-use Html;
 use IContextSource;
 use MediaWiki\Logger\LoggerFactory;
 use OutputPage;
-use RCCacheEntry;
 use 

[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Move Contributions and ChangesList hook handlers to their de...

2017-11-20 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392415 )

Change subject: Move Contributions and ChangesList hook handlers to their 
dedicated files
..

Move Contributions and ChangesList hook handlers to their dedicated files

It's just moving the code around and makes the Hook class bearably clean

Change-Id: I35247553444d595330f149c6c5b1f29165ee1e40
---
M extension.json
M includes/Hooks.php
A includes/Hooks/ChangesListHooksHandler.php
A includes/Hooks/ContributionsHooksHandler.php
A tests/phpunit/includes/Hooks/ChangesListHooksHandlerTest.php
A tests/phpunit/includes/Hooks/ContributionsHookHandlerTest.php
M tests/phpunit/includes/HooksTest.php
7 files changed, 1,336 insertions(+), 1,223 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES 
refs/changes/15/392415/1

diff --git a/extension.json b/extension.json
index c3ce04a..63f226b 100644
--- a/extension.json
+++ b/extension.json
@@ -13,6 +13,8 @@
"ORES\\Cache": "includes/Cache.php",
"ORES\\Hooks": "includes/Hooks.php",
"ORES\\Hooks\\ApiHooksHandler": 
"includes/Hooks/ApiHooksHandler.php",
+   "ORES\\Hooks\\ChangesListHooksHandler": 
"includes/Hooks/ChangesListHooksHandler.php",
+   "ORES\\Hooks\\ContributionsHooksHandler": 
"includes/Hooks/ContributionsHooksHandler.php",
"ORES\\Hooks\\PreferencesHookHandler": 
"includes/Hooks/PreferencesHookHandler.php",
"ORES\\FetchScoreJob": "includes/FetchScoreJob.php",
"ORES\\Range": "includes/Range.php",
@@ -50,19 +52,19 @@
"ORES\\Hooks::onBeforePageDisplay"
],
"ChangesListSpecialPageStructuredFilters": [
-   "ORES\\Hooks::onChangesListSpecialPageStructuredFilters"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onChangesListSpecialPageStructuredFilters"
],
"ChangesListSpecialPageQuery": [
-   "ORES\\Hooks::onChangesListSpecialPageQuery"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onChangesListSpecialPageQuery"
],
"ContribsPager::getQueryInfo": [
-   "ORES\\Hooks::onContribsGetQueryInfo"
+   
"ORES\\Hooks\\ContributionsHooksHandler::onContribsGetQueryInfo"
],
"EnhancedChangesListModifyBlockLineData": [
-   "ORES\\Hooks::onEnhancedChangesListModifyBlockLineData"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onEnhancedChangesListModifyBlockLineData"
],
"EnhancedChangesListModifyLineData": [
-   "ORES\\Hooks::onEnhancedChangesListModifyLineData"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onEnhancedChangesListModifyLineData"
],
"GetBetaFeaturePreferences": [
"ORES\\Hooks::onGetBetaFeaturePreferences"
@@ -74,7 +76,7 @@
"ORES\\Hooks::onLoadExtensionSchemaUpdates"
],
"OldChangesListRecentChangesLine": [
-   "ORES\\Hooks::onOldChangesListRecentChangesLine"
+   
"ORES\\Hooks\\ChangesListHooksHandler::onOldChangesListRecentChangesLine"
],
"RecentChange_save": [
"ORES\\Hooks::onRecentChange_save"
@@ -83,13 +85,13 @@
"ORES\\Hooks::onRecentChangesPurgeRows"
],
"SpecialContributions::formatRow::flags": [
-   "ORES\\Hooks::onSpecialContributionsFormatRowFlags"
+   
"ORES\\Hooks\\ContributionsHooksHandler::onSpecialContributionsFormatRowFlags"
],
"ContributionsLineEnding": [
-   "ORES\\Hooks::onContributionsLineEnding"
+   
"ORES\\Hooks\\ContributionsHooksHandler::onContributionsLineEnding"
],
"SpecialContributions::getForm::filters": [
-   "ORES\\Hooks::onSpecialContributionsGetFormFilters"
+   
"ORES\\Hooks\\ContributionsHooksHandler::onSpecialContributionsGetFormFilters"
]
},
"ResourceFileModulePaths": {
diff --git a/includes/Hooks.php b/includes/Hooks.php
index b0d53aa..78c71c3 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -3,29 +3,18 @@
 namespace ORES;
 
 use BetaFeatures;
-use ChangesList;
-use ChangesListBooleanFilterGroup;
-use ChangesListSpecialPage;
-use ChangesListStringOptionsFilterGroup;
-use ContribsPager;
 use DatabaseUpdater;
-use EnhancedChangesList;
 use Exception;
-use FormOptions;
 use JobQueueGroup;
-use Html;
 use IContextSource;
 use MediaWiki\Logger\LoggerFactory;
 use OutputPage;
-use RCCacheEntry;