[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Hard deprecate wfRunHooks()

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

Change subject: Hard deprecate wfRunHooks()
..


Hard deprecate wfRunHooks()

Deprecated since 1.25, very few callers. Having to grep for 2
ways of calling a hook is harmful not only because it wastes developers'
time, but also because it makes it possible to forget to search for the
old way, resulting in mistakes. Better get rid of this.

Change-Id: Iab28bd5758475b780c2016847881757d64973862
---
M includes/GlobalFunctions.php
M tests/phpunit/includes/HooksTest.php
2 files changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Krinkle: Looks good to me, but someone else must approve
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index ffdfc92..1cff881 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3232,6 +3232,7 @@
  * @deprecated since 1.25 - use Hooks::run
  */
 function wfRunHooks( $event, array $args = [], $deprecatedVersion = null ) {
+   wfDeprecated( __METHOD__, '1.25' );
return Hooks::run( $event, $args, $deprecatedVersion );
 }
 
diff --git a/tests/phpunit/includes/HooksTest.php 
b/tests/phpunit/includes/HooksTest.php
index 87acb52..6660516 100644
--- a/tests/phpunit/includes/HooksTest.php
+++ b/tests/phpunit/includes/HooksTest.php
@@ -54,6 +54,8 @@
 */
public function testOldStyleHooks( $msg, array $hook, $expectedFoo, 
$expectedBar ) {
global $wgHooks;
+
+   $this->hideDeprecated( 'wfRunHooks' );
$foo = $bar = 'original';
 
$wgHooks['MediaWikiHooksTest001'][] = $hook;

-- 
To view, visit https://gerrit.wikimedia.org/r/376866
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab28bd5758475b780c2016847881757d64973862
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jeroen De Dauw 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Hard deprecate wfRunHooks()

2017-09-08 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/376866 )

Change subject: Hard deprecate wfRunHooks()
..

Hard deprecate wfRunHooks()

Deprecated since 1.25, very few callers. Having to grep for 2
ways of calling a hook is harmful not only because it wastes developers'
time, but also because it makes it possible to forget to search for the
old way, resulting in mistakes. Better get rid of this.

Change-Id: Iab28bd5758475b780c2016847881757d64973862
---
M includes/GlobalFunctions.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/376866/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 3bd73e6..a286098 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3476,6 +3476,7 @@
  * @deprecated since 1.25 - use Hooks::run
  */
 function wfRunHooks( $event, array $args = [], $deprecatedVersion = null ) {
+   wfDeprecated( __METHOD__, '1.25' );
return Hooks::run( $event, $args, $deprecatedVersion );
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/376866
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab28bd5758475b780c2016847881757d64973862
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits