[MediaWiki-commits] [Gerrit] mediawiki...ArticlePlaceholder[master]: Type hint against IDatabase instead of Database

2018-01-24 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406056 )

Change subject: Type hint against IDatabase instead of Database
..

Type hint against IDatabase instead of Database

The interface is smaller, and all that's needed here.

This patch also removes an obsolete documentation that is 100%
identical to the method header.

Change-Id: Ia666dec4dfea7089183d4adb5c42bf6ffbf0b4f6
---
M includes/BaseTemplateToolboxHookHandler.php
M includes/ItemNotabilityFilter.php
2 files changed, 3 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder 
refs/changes/56/406056/1

diff --git a/includes/BaseTemplateToolboxHookHandler.php 
b/includes/BaseTemplateToolboxHookHandler.php
index 986ff2c..afbc19d 100644
--- a/includes/BaseTemplateToolboxHookHandler.php
+++ b/includes/BaseTemplateToolboxHookHandler.php
@@ -49,11 +49,6 @@
);
}
 
-   /**
-* @param EntityIdParser $entityIdParser
-* @param RepoLinker $repoLinker
-* @param EntityLookup $entityLookup
-*/
public function __construct(
EntityIdParser $entityIdParser,
RepoLinker $repoLinker,
diff --git a/includes/ItemNotabilityFilter.php 
b/includes/ItemNotabilityFilter.php
index 3974a62..d41d2d3 100644
--- a/includes/ItemNotabilityFilter.php
+++ b/includes/ItemNotabilityFilter.php
@@ -5,7 +5,7 @@
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\Lib\Store\EntityNamespaceLookup;
 use Wikibase\Lib\Store\SiteLinkLookup;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\ResultWrapper;
 use Wikimedia\Rdbms\SessionConsistentConnectionManager;
 
@@ -120,12 +120,12 @@
}
 
/**
-* @param Database $dbr
+* @param IDatabase $dbr
 * @param ItemId[] $itemIds
 *
 * @return ResultWrapper
 */
-   private function selectPagePropsPage( Database $dbr, array $itemIds ) {
+   private function selectPagePropsPage( IDatabase $dbr, array $itemIds ) {
$entityNamespace = 
$this->entityNamespaceLookup->getEntityNamespace( 'item' );
 
if ( !is_int( $entityNamespace ) ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia666dec4dfea7089183d4adb5c42bf6ffbf0b4f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...ArticlePlaceholder[master]: Add more test cases to improve overall test coverage

2018-01-24 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406054 )

Change subject: Add more test cases to improve overall test coverage
..

Add more test cases to improve overall test coverage

Change-Id: I28547aa378977d1c379e7e709357d9916c511e1f
---
M tests/phpunit/includes/HooksTest.php
A tests/phpunit/includes/Lua/Scribunto_LuaArticlePlaceholderLibraryTest.php
2 files changed, 99 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder 
refs/changes/54/406054/1

diff --git a/tests/phpunit/includes/HooksTest.php 
b/tests/phpunit/includes/HooksTest.php
index 1e9a960..e5c9e5a 100644
--- a/tests/phpunit/includes/HooksTest.php
+++ b/tests/phpunit/includes/HooksTest.php
@@ -15,6 +15,15 @@
  */
 class HooksTest extends PHPUnit_Framework_TestCase {
 
+   public function testOnScribuntoExternalLibraries() {
+   $instance = new Hooks();
+   $extraLibraries = [];
+   $instance->onScribuntoExternalLibraries( 'lua', $extraLibraries 
);
+   $this->assertCount( 1, $extraLibraries );
+   $this->assertContainsOnly( 'array', $extraLibraries );
+   $this->assertArrayHasKey( 'class', reset( $extraLibraries ) );
+   }
+
public function testRegisterScribuntoExternalLibraryPaths() {
$instance = new Hooks();
$paths = [];
diff --git 
a/tests/phpunit/includes/Lua/Scribunto_LuaArticlePlaceholderLibraryTest.php 
b/tests/phpunit/includes/Lua/Scribunto_LuaArticlePlaceholderLibraryTest.php
new file mode 100644
index 000..ffaec0f
--- /dev/null
+++ b/tests/phpunit/includes/Lua/Scribunto_LuaArticlePlaceholderLibraryTest.php
@@ -0,0 +1,90 @@
+setMwGlobals( [
+   'wgArticlePlaceholderImageProperty' => 'P2001',
+   'wgArticlePlaceholderReferencesBlacklist' => 'P2002',
+   ] );
+   }
+
+   public function testGetImageProperty() {
+   $instance = $this->newInstance();
+
+   $actual = $instance->getImageProperty();
+   $this->assertSame( [ 'P2001' ], $actual );
+   }
+
+   public function testGetImageProperty_throwsException() {
+   $this->setMwGlobals( 'wgArticlePlaceholderImageProperty', '' );
+   $instance = $this->newInstance();
+
+   $this->setExpectedException( RuntimeException::class );
+   $instance->getImageProperty();
+   }
+
+   public function testGetReferencesBlacklist() {
+   $instance = $this->newInstance();
+
+   $actual = $instance->getReferencesBlacklist();
+   $this->assertSame( [ 'P2002' ], $actual );
+   }
+
+   public function testGetReferencesBlacklist_returnsNull() {
+   $this->setMwGlobals( 'wgArticlePlaceholderReferencesBlacklist', 
'' );
+   $instance = $this->newInstance();
+
+   $actual = $instance->getReferencesBlacklist();
+   $this->assertNull( $actual );
+   }
+
+   public function testRegister() {
+   $engine = $this->getMockBuilder( Scribunto_LuaEngine::class )
+   ->disableOriginalConstructor()
+   ->getMock();
+   $engine->expects( $this->once() )
+   ->method( 'registerInterface' )
+   ->willReturnCallback( function (
+   $moduleFileName,
+   array $interfaceFuncs,
+   array $setupOptions
+   ) {
+   $this->assertFileExists( $moduleFileName );
+   $this->assertInternalType( 'callable', 
$interfaceFuncs['getImageProperty'] );
+   $this->assertInternalType( 'callable', 
$interfaceFuncs['getReferencesBlacklist'] );
+
+   return 'dummyReturnValue';
+   } );
+   $instance = new Scribunto_LuaArticlePlaceholderLibrary( $engine 
);
+
+   $actual = $instance->register();
+   $this->assertSame( 'dummyReturnValue', $actual );
+   }
+
+   private function newInstance() {
+   $engine = $this->getMockBuilder( Scribunto_LuaEngine::class )
+   ->disableOriginalConstructor()
+   ->getMock();
+
+   return new Scribunto_LuaArticlePlaceholderLibrary( $engine );
+   }
+
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28547aa378977d1c379e7e709357d9916c511e1f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix type hint for PoolWorkArticleView::getParserOutput

2018-01-24 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406038 )

Change subject: Fix type hint for PoolWorkArticleView::getParserOutput
..

Fix type hint for PoolWorkArticleView::getParserOutput

Change-Id: Ib6a71e198481cf2a0230b3f8721c019ef3c7288c
---
M includes/poolcounter/PoolWorkArticleView.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/406038/1

diff --git a/includes/poolcounter/PoolWorkArticleView.php 
b/includes/poolcounter/PoolWorkArticleView.php
index 17b62d7..7b888ab 100644
--- a/includes/poolcounter/PoolWorkArticleView.php
+++ b/includes/poolcounter/PoolWorkArticleView.php
@@ -79,7 +79,7 @@
/**
 * Get the ParserOutput from this object, or false in case of failure
 *
-* @return ParserOutput
+* @return ParserOutput|bool
 */
public function getParserOutput() {
return $this->parserOutput;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6a71e198481cf2a0230b3f8721c019ef3c7288c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Remove meaningless comments repeating the class name twice

2018-01-24 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406033 )

Change subject: Remove meaningless comments repeating the class name twice
..

Remove meaningless comments repeating the class name twice

Remove all comments stating the "File holding the … class" as well as
"The … class."

These comments do nothing but repeating the class name. The generated
documentation will state that a file named (for example) Foo.php "holds
the Foo class". In an other place the documentation will state that the
class "Foo" is "the Foo class".

Such comments are worse than having no comments, because I need to read
them to understand they do not hold any additional information, and do
not explain anything. Removing these comments makes room for actual
improvements in the future.

Note there are actual mistakes in some of these comments, e.g. because
the class got renamed, but the comment not updated.

Change-Id: I54ad9ac68684f558228f1b646f97da2c14674ca8
---
M includes/PF_AutoeditAPI.php
M includes/forminputs/PF_CheckboxInput.php
M includes/forminputs/PF_CheckboxesInput.php
M includes/forminputs/PF_ComboBoxInput.php
M includes/forminputs/PF_DateInput.php
M includes/forminputs/PF_DatePickerInput.php
M includes/forminputs/PF_DateTimeInput.php
M includes/forminputs/PF_DateTimePicker.php
M includes/forminputs/PF_DropdownInput.php
M includes/forminputs/PF_EnumInput.php
M includes/forminputs/PF_FormInput.php
M includes/forminputs/PF_GoogleMapsInput.php
M includes/forminputs/PF_LeafletInput.php
M includes/forminputs/PF_ListBoxInput.php
M includes/forminputs/PF_MultiEnumInput.php
M includes/forminputs/PF_OpenLayersInput.php
M includes/forminputs/PF_RadioButtonInput.php
M includes/forminputs/PF_RatingInput.php
M includes/forminputs/PF_RegExpInput.php
M includes/forminputs/PF_TextAreaInput.php
M includes/forminputs/PF_TextAreaWithAutocompleteInput.php
M includes/forminputs/PF_TextInput.php
M includes/forminputs/PF_TextWithAutocompleteInput.php
M includes/forminputs/PF_TimePickerInput.php
M includes/forminputs/PF_TokensInput.php
M includes/forminputs/PF_TreeInput.php
M includes/forminputs/PF_YearInput.php
27 files changed, 0 insertions(+), 102 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/33/406033/1

diff --git a/includes/PF_AutoeditAPI.php b/includes/PF_AutoeditAPI.php
index a403101..d0d9440 100644
--- a/includes/PF_AutoeditAPI.php
+++ b/includes/PF_AutoeditAPI.php
@@ -1,15 +1,11 @@
 https://gerrit.wikimedia.org/r/406033
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54ad9ac68684f558228f1b646f97da2c14674ca8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Add a @covers tag to the only test

2018-01-24 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406032 )

Change subject: Add a @covers tag to the only test
..

Add a @covers tag to the only test

Change-Id: I16b047c965e2ebcf47576ba8b0a462d9da5783be
---
M tests/phpunit/includes/PF_FormPrinterTest.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/32/406032/1

diff --git a/tests/phpunit/includes/PF_FormPrinterTest.php 
b/tests/phpunit/includes/PF_FormPrinterTest.php
index 098a403..41919b3 100644
--- a/tests/phpunit/includes/PF_FormPrinterTest.php
+++ b/tests/phpunit/includes/PF_FormPrinterTest.php
@@ -1,6 +1,7 @@
 https://gerrit.wikimedia.org/r/406032
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16b047c965e2ebcf47576ba8b0a462d9da5783be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Gadgets[master]: Fix PHPDocs of GadgetDefinitionContent::getDeletionUpdates

2018-01-24 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406031 )

Change subject: Fix PHPDocs of GadgetDefinitionContent::getDeletionUpdates
..

Fix PHPDocs of GadgetDefinitionContent::getDeletionUpdates

DataUpdate is a specific implementation (currently the only one), while
DeferrableUpdate is the interface. Binding against the interface is
enough, and what the base classes already do.

I'm also removing a line of meaningless documentation. "Creates an
instance of this class" is a general description that is true for all
constructors.

Change-Id: Ia6dc86b078628db5e0ab68ef46bf0396567b767c
---
M includes/GadgetResourceLoaderModule.php
M includes/content/GadgetDefinitionContent.php
2 files changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gadgets 
refs/changes/31/406031/1

diff --git a/includes/GadgetResourceLoaderModule.php 
b/includes/GadgetResourceLoaderModule.php
index e1b2602..13d16cd 100644
--- a/includes/GadgetResourceLoaderModule.php
+++ b/includes/GadgetResourceLoaderModule.php
@@ -16,8 +16,6 @@
private $gadget;
 
/**
-* Creates an instance of this class
-*
 * @param array $options
 */
public function __construct( array $options ) {
diff --git a/includes/content/GadgetDefinitionContent.php 
b/includes/content/GadgetDefinitionContent.php
index b5aa7cf..cede38d 100644
--- a/includes/content/GadgetDefinitionContent.php
+++ b/includes/content/GadgetDefinitionContent.php
@@ -97,7 +97,7 @@
/**
 * @param WikiPage $page
 * @param ParserOutput $parserOutput
-* @return DataUpdate[]
+* @return DeferrableUpdate[]
 */
public function getDeletionUpdates( WikiPage $page, ParserOutput 
$parserOutput = null ) {
return array_merge(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6dc86b078628db5e0ab68ef46bf0396567b767c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gadgets
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...BetaFeatures[master]: Add missing @covers tags to existing test cases

2018-01-24 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406030 )

Change subject: Add missing @covers tags to existing test cases
..

Add missing @covers tags to existing test cases

This is quite trivial, I believe. No need to fiddle with function-level
@covers tags here.

Change-Id: I12027f6f98952cc8fdca5722dc75ac5c300105af
---
M tests/phpunit/AutoEnrollmentTest.php
M tests/phpunit/DependentFeatureTest.php
M tests/phpunit/HTMLFeatureFieldTest.php
M tests/phpunit/HTMLHorizontalRuleTest.php
M tests/phpunit/HTMLTextBlockTest.php
M tests/phpunit/HooksRunTest.php
M tests/phpunit/NewHTMLCheckFieldTest.php
M tests/phpunit/PreferenceHandlingTest.php
8 files changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BetaFeatures 
refs/changes/30/406030/1

diff --git a/tests/phpunit/AutoEnrollmentTest.php 
b/tests/phpunit/AutoEnrollmentTest.php
index 3b801dd..b7c6a61 100644
--- a/tests/phpunit/AutoEnrollmentTest.php
+++ b/tests/phpunit/AutoEnrollmentTest.php
@@ -24,6 +24,8 @@
  */
 
 /**
+ * @covers \BetaFeaturesHooks::getPreferences
+ *
  * @group BetaFeatures
  */
 class AutoEnrollmentTest extends BetaFeaturesTestCase {
diff --git a/tests/phpunit/DependentFeatureTest.php 
b/tests/phpunit/DependentFeatureTest.php
index bc9f8bf..8e486b0 100644
--- a/tests/phpunit/DependentFeatureTest.php
+++ b/tests/phpunit/DependentFeatureTest.php
@@ -24,6 +24,8 @@
  */
 
 /**
+ * @covers \BetaFeaturesHooks::getPreferences
+ *
  * @group BetaFeatures
  */
 class DependentFeatureTest extends BetaFeaturesTestCase {
diff --git a/tests/phpunit/HTMLFeatureFieldTest.php 
b/tests/phpunit/HTMLFeatureFieldTest.php
index 3266e7f..b69ec16 100644
--- a/tests/phpunit/HTMLFeatureFieldTest.php
+++ b/tests/phpunit/HTMLFeatureFieldTest.php
@@ -24,6 +24,8 @@
  */
 
 /**
+ * @covers \HTMLFeatureField
+ *
  * @group BetaFeatures
  */
 class HTMLFeatureFieldTest extends MediaWikiTestCase {
diff --git a/tests/phpunit/HTMLHorizontalRuleTest.php 
b/tests/phpunit/HTMLHorizontalRuleTest.php
index 5b27836..2b3ce41 100644
--- a/tests/phpunit/HTMLHorizontalRuleTest.php
+++ b/tests/phpunit/HTMLHorizontalRuleTest.php
@@ -24,6 +24,8 @@
  */
 
 /**
+ * @covers \HTMLHorizontalRuleField
+ *
  * @group BetaFeatures
  */
 class HTMLHorizontalRuleFieldTest extends MediaWikiTestCase {
diff --git a/tests/phpunit/HTMLTextBlockTest.php 
b/tests/phpunit/HTMLTextBlockTest.php
index 3de29c8..8b4fb63 100644
--- a/tests/phpunit/HTMLTextBlockTest.php
+++ b/tests/phpunit/HTMLTextBlockTest.php
@@ -24,6 +24,8 @@
  */
 
 /**
+ * @covers \HTMLTextBlockField
+ *
  * @group BetaFeatures
  */
 class HTMLTextBlockFieldTest extends MediaWikiTestCase {
diff --git a/tests/phpunit/HooksRunTest.php b/tests/phpunit/HooksRunTest.php
index 15727e0..99e8265 100644
--- a/tests/phpunit/HooksRunTest.php
+++ b/tests/phpunit/HooksRunTest.php
@@ -24,6 +24,8 @@
  */
 
 /**
+ * @covers \BetaFeaturesHooks::getPreferences
+ *
  * @group BetaFeatures
  */
 class HooksRunTest extends MediaWikiTestCase {
diff --git a/tests/phpunit/NewHTMLCheckFieldTest.php 
b/tests/phpunit/NewHTMLCheckFieldTest.php
index 0f07b15..5b9bc42 100644
--- a/tests/phpunit/NewHTMLCheckFieldTest.php
+++ b/tests/phpunit/NewHTMLCheckFieldTest.php
@@ -24,6 +24,8 @@
  */
 
 /**
+ * @covers \NewHTMLCheckField
+ *
  * @group BetaFeatures
  */
 class NewHTMLCheckFieldTest extends MediaWikiTestCase {
diff --git a/tests/phpunit/PreferenceHandlingTest.php 
b/tests/phpunit/PreferenceHandlingTest.php
index a36532f..a522c80 100644
--- a/tests/phpunit/PreferenceHandlingTest.php
+++ b/tests/phpunit/PreferenceHandlingTest.php
@@ -24,6 +24,8 @@
  */
 
 /**
+ * @covers \BetaFeaturesHooks::getPreferences
+ *
  * @group BetaFeatures
  */
 class PreferenceHandlingTest extends BetaFeaturesTestCase {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12027f6f98952cc8fdca5722dc75ac5c300105af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BetaFeatures
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...GeoData[master]: Add missing @covers tags to existing test cases

2018-01-24 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406029 )

Change subject: Add missing @covers tags to existing test cases
..

Add missing @covers tags to existing test cases

I'm intentionally adding both class-level as well as function-level
@covers tags:
* I am adding function-level @covers when it is obvious a test case is
  meant to test this single function only. Everything else would be
  accidential coverage, which I don't want.
* I'm adding @covers on the class level when it is obvious which class
  is under test. This is helpful because there are some test cases that
  test a whole feature set of a class, and not only a specific method.
  This is obviously not possible for "misc" test cases.

Change-Id: Ic7d5b8b2e81cf09753a2f7bf73dfd2304f69b1b6
---
M tests/phpunit/BoundingBoxTest.php
M tests/phpunit/CoordTest.php
M tests/phpunit/GeoDataMathTest.php
M tests/phpunit/GeoFeatureTest.php
M tests/phpunit/GeoSearchTest.php
M tests/phpunit/GlobeTest.php
M tests/phpunit/MiscGeoDataTest.php
M tests/phpunit/ParseCoordTest.php
M tests/phpunit/TagTest.php
9 files changed, 30 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData 
refs/changes/29/406029/1

diff --git a/tests/phpunit/BoundingBoxTest.php 
b/tests/phpunit/BoundingBoxTest.php
index 29fc5fb..09cc178 100644
--- a/tests/phpunit/BoundingBoxTest.php
+++ b/tests/phpunit/BoundingBoxTest.php
@@ -6,10 +6,13 @@
 use MediaWikiTestCase;
 
 /**
+ * @covers \GeoData\BoundingBox
+ *
  * @group GeoData
  */
 class BoundingBoxTest extends MediaWikiTestCase {
/**
+* @covers \GeoData\BoundingBox::center
 * @dataProvider provideCenter
 */
public function testCenter( $latExpected, $lonExpected, $lat1, $lon1, 
$lat2, $lon2 ) {
diff --git a/tests/phpunit/CoordTest.php b/tests/phpunit/CoordTest.php
index e8a52e7..a696415 100644
--- a/tests/phpunit/CoordTest.php
+++ b/tests/phpunit/CoordTest.php
@@ -8,12 +8,15 @@
 use MediaWikiTestCase;
 
 /**
+ * @covers \GeoData\Coord
+ *
  * @todo: More tests
  * @group GeoData
  */
 class CoordTest extends MediaWikiTestCase {
 
/**
+* @covers \GeoData\Coord::equalsTo
 * @dataProvider provideEquals
 * @param Coord $coord1
 * @param Coord $coord2
@@ -112,6 +115,7 @@
}
 
/**
+* @covers \GeoData\Coord::fullyEqualsTo
 * @dataProvider provideFullyEquals
 *
 * @param Coord $coord1
@@ -237,6 +241,9 @@
return array_merge( $this->provideAlwaysEqualCoords(), 
$testCases );
}
 
+   /**
+* @covers \GeoData\Coord::bboxAround
+*/
public function testBboxAround() {
for ( $i = 0; $i < 90; $i += 5 ) {
$coord = new Coord( $i, $i );
@@ -249,6 +256,7 @@
}
 
/**
+* @covers \GeoData\Coord::getGlobeObj
 * @dataProvider provideGlobeObj
 */
public function testGlobeObj( $name, Globe $expected ) {
diff --git a/tests/phpunit/GeoDataMathTest.php 
b/tests/phpunit/GeoDataMathTest.php
index d867f7c..0212609 100644
--- a/tests/phpunit/GeoDataMathTest.php
+++ b/tests/phpunit/GeoDataMathTest.php
@@ -7,10 +7,13 @@
 use MediaWikiTestCase;
 
 /**
+ * @covers \GeoData\Math
+ *
  * @group GeoData
  */
 class GeoDataMathTest extends MediaWikiTestCase {
/**
+* @covers \GeoData\Math::distance
 * @dataProvider getDistanceData
 */
public function testDistance( $lat1, $lon1, $lat2, $lon2, $dist, $name 
) {
@@ -29,6 +32,8 @@
}
 
/**
+* @covers \GeoData\Coord::bboxAround
+* @covers \GeoData\Math::wrapAround
 * @dataProvider getRectData
 * @todo: test directly now that this function is public
 */
diff --git a/tests/phpunit/GeoFeatureTest.php b/tests/phpunit/GeoFeatureTest.php
index 2799887..3a76901 100644
--- a/tests/phpunit/GeoFeatureTest.php
+++ b/tests/phpunit/GeoFeatureTest.php
@@ -11,7 +11,7 @@
 use Wikimedia\Rdbms\LoadBalancer;
 
 /**
- * Test GeoFeature functions.
+ * @covers \GeoData\CirrusGeoFeature
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -93,6 +93,7 @@
}
 
/**
+* @covers \GeoData\CirrusGeoFeature::parseDistance
 * @dataProvider parseDistanceProvider
 */
public function testParseDistance( $expected, $distance ) {
@@ -162,6 +163,7 @@
}
 
/**
+* @covers \GeoData\CirrusGeoFeature::parseGeoNearby
 * @dataProvider parseGeoNearbyProvider
 */
public function testParseGeoNearby( $expected, $value ) {
@@ -244,6 +246,7 @@
}
 
/**
+* @covers \GeoData\CirrusGeoFeature::parseGeoNearbyTitle
 * @dataProvider parseGeoNearbyTitleProvider
  

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix smaller mistakes in UsageDeduplicator

2018-01-23 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405895 )

Change subject: Fix smaller mistakes in UsageDeduplicator
..

Fix smaller mistakes in UsageDeduplicator

Bug: T178079
Change-Id: I72fe1aeb3df2d36f322e6579994584f88aa0e4a8
---
M client/includes/Usage/UsageDeduplicator.php
M client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php
2 files changed, 27 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/95/405895/1

diff --git a/client/includes/Usage/UsageDeduplicator.php 
b/client/includes/Usage/UsageDeduplicator.php
index 10c5feb..8c7e4ce 100644
--- a/client/includes/Usage/UsageDeduplicator.php
+++ b/client/includes/Usage/UsageDeduplicator.php
@@ -25,9 +25,8 @@
$return = [];
array_walk_recursive(
$structuredUsages,
-   function( $a ) use ( &$return ) {
-   /* @var EntityUsage $a */
-   $return[$a->getIdentityString()] = $a;
+   function ( EntityUsage $usage ) use ( &$return ) {
+   $return[$usage->getIdentityString()] = $usage;
}
);
return $return;
@@ -65,8 +64,8 @@
}
 
/**
-* @param EntityUsage[] $usages
-* @return EntityUsage[]
+* @param array[] $usages
+* @return array[]
 */
private function deduplicateUsagesPerEntity( array $usages ) {
$usages[EntityUsage::DESCRIPTION_USAGE] = 
$this->deduplicatePerType(
diff --git a/client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php 
b/client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php
index cf2041e..a536369 100644
--- a/client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php
+++ b/client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php
@@ -31,19 +31,35 @@
$q2DescriptionFa = new EntityUsage( $q2, 
EntityUsage::DESCRIPTION_USAGE, 'fa' );
 
return [
-   [ [ $q1LabelEn, $q1Label ], [ $q1Label ] ],
-   [ [ $q1LabelEn ], [ $q1LabelEn ] ],
-   [ [ $q1LabelEn, $q1Label, $q2Description, $q1All ], [ 
$q1Label, $q1All, $q2Description ] ],
-   [ [ $q1LabelEn, $q2Label, $q1Statement ], [ $q1LabelEn, 
$q1Statement, $q2Label ] ],
-   [ [ $q2DescriptionFa, $q2Description, $q1All ], [ 
$q2Description, $q1All ] ],
+   [
+   [ $q1LabelEn, $q1Label ],
+   [ $q1Label ]
+   ],
+   [
+   [ $q1LabelEn ],
+   [ $q1LabelEn ]
+   ],
+   [
+   [ $q1Label, $q1LabelEn, $q2Description, $q1All 
],
+   [ $q1Label, $q2Description, $q1All ]
+   ],
+   [
+   [ $q1LabelEn, $q2Label, $q1Statement ],
+   [ $q1LabelEn, $q2Label, $q1Statement ]
+   ],
+   [
+   [ $q2Description, $q2DescriptionFa, $q1All ],
+   [ $q2Description, $q1All ]
+   ],
];
}
 
/**
-* @covers \Wikibase\Client\Usage\UsageDeduplicator::deduplicate
 * @dataProvider provideDeduplicate
+* @param EntityUsage[] $usages
+* @param EntityUsage[] $output
 */
-   public function testDeduplicate( $usages, $output ) {
+   public function testDeduplicate( array $usages, array $output ) {
$expected = [];
foreach ( $output as $usage ) {
$expected[$usage->getIdentityString()] = $usage;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72fe1aeb3df2d36f322e6579994584f88aa0e4a8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Rearrange UsageDeduplicator implementation

2018-01-23 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405896 )

Change subject: Rearrange UsageDeduplicator implementation
..

Rearrange UsageDeduplicator implementation

This is basically the exact same implementation, just moved around a
bit. I found the way the code was previously arranged not that optimal.
The code was spread out quite a lot.

Significant changes are:
* The actual deduplication intentionally replaces an array of usages
  with a single usage. This makes the later array_walk_recursive run
  faster because it does have less 1-element arrays to iterate.
* The actual deduplication use &-references to manipulate the one array,
  instead of constantly constructing new ones.
* Structuring is done in one step instead of two. $array[$foo][$bar][]
  works just fine here.
* Note that labels and descriptions are not mentioned any more! The same
  deduplication logic is applied to all aspects, not only labels and
  descriptions. This might be a mistake, but no test fails. If you think
  this is a mistake, please add a test that demonstrates why.

Bug: T178079
Change-Id: Ic8ec86088d49b5979a78e99d2cafce5f6c86f94d
---
M client/includes/Usage/UsageDeduplicator.php
1 file changed, 37 insertions(+), 47 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/96/405896/1

diff --git a/client/includes/Usage/UsageDeduplicator.php 
b/client/includes/Usage/UsageDeduplicator.php
index 8c7e4ce..a9126dc 100644
--- a/client/includes/Usage/UsageDeduplicator.php
+++ b/client/includes/Usage/UsageDeduplicator.php
@@ -12,81 +12,71 @@
 
/**
 * @param EntityUsage[] $usages
+*
 * @return EntityUsage[]
 */
public function deduplicate( array $usages ) {
-   $structuredUsages = $this->structureUsages( $usages );
-
-   foreach ( $structuredUsages as $entityId => $usages ) {
-   $structuredUsages[$entityId] = 
$this->deduplicateUsagesPerEntity( $usages );
-   }
-
-   // Flatten the structured array
-   $return = [];
-   array_walk_recursive(
-   $structuredUsages,
-   function ( EntityUsage $usage ) use ( &$return ) {
-   $return[$usage->getIdentityString()] = $usage;
-   }
+   return $this->flattenStructuredUsages(
+   $this->deduplicateStructuredUsages(
+   $this->structureUsages( $usages )
+   )
);
-   return $return;
}
 
/**
 * @param EntityUsage[] $usages
-* @return array[]
+*
+* @return array[] three-dimensional array of
+*  [ $entityId => [ $aspectKey => [ EntityUsage $usage, … ], … ], … ]
 */
private function structureUsages( array $usages ) {
$structuredUsages = [];
-   foreach ( $usages as $usage ) {
-   $entityId = $usage->getEntityId();
-   $structuredUsages[$entityId->getSerialization()][] = 
$usage;
-   }
 
-   return array_map( [ $this, 'structureUsagesPerEntity' ], 
$structuredUsages );
-   }
-
-   /**
-* @param EntityUsage[] $usages
-* @return array[]
-*/
-   private function structureUsagesPerEntity( array $usages ) {
-   $structuredUsages = [
-   EntityUsage::DESCRIPTION_USAGE => [],
-   EntityUsage::LABEL_USAGE => [],
-   ];
foreach ( $usages as $usage ) {
+   $entityId = $usage->getEntityId()->getSerialization();
$aspect = $usage->getAspect();
-   $structuredUsages[$aspect][] = $usage;
+   $structuredUsages[$entityId][$aspect][] = $usage;
}
 
return $structuredUsages;
}
 
/**
-* @param array[] $usages
+* @param array[] $structuredUsages
+*
 * @return array[]
 */
-   private function deduplicateUsagesPerEntity( array $usages ) {
-   $usages[EntityUsage::DESCRIPTION_USAGE] = 
$this->deduplicatePerType(
-   $usages[EntityUsage::DESCRIPTION_USAGE]
-   );
-   $usages[EntityUsage::LABEL_USAGE] = $this->deduplicatePerType(
-   $usages[EntityUsage::LABEL_USAGE]
-   );
-   return $usages;
+   private function deduplicateStructuredUsages( array $structuredUsages ) 
{
+   foreach ( $structuredUsages as &$usagesPerEntity ) {
+   /** @var EntityUsage[] $usagesPerType */
+   foreach ( $usagesPerEntity as &$usagesPerType ) {
+

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Rewrite ConstraintParameterRendererTest::assertConstraintRep...

2018-01-23 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405877 )

Change subject: Rewrite 
ConstraintParameterRendererTest::assertConstraintReportParameterList
..

Rewrite ConstraintParameterRendererTest::assertConstraintReportParameterList

Instead of fiddling with $expected and constructing a pretty complex array
(and by doing so repeating parts of the implementation from
ConstraintParameterRenderer), I turn it around and rip $actual appart to
compare it.

This also fixes an actual mistake with an array key.

Bug: T169121
Change-Id: Ic8715c3338fe0b42314639519a524c1b50896e29
---
M tests/phpunit/ConstraintParameterRendererTest.php
1 file changed, 8 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/77/405877/1

diff --git a/tests/phpunit/ConstraintParameterRendererTest.php 
b/tests/phpunit/ConstraintParameterRendererTest.php
index 14ce764..a5278bd 100644
--- a/tests/phpunit/ConstraintParameterRendererTest.php
+++ b/tests/phpunit/ConstraintParameterRendererTest.php
@@ -555,7 +555,7 @@
);
 
$this->assertConstraintReportParameterList(
-   array_fill( 0, 10, 'statement' ) + [ 11 => '...' ],
+   array_fill( 0, 10, 'statement' ) + [ 10 => '...' ],
$formatted
);
}
@@ -565,11 +565,13 @@
 * @param string $actual
 */
private function assertConstraintReportParameterList( array $expected, 
$actual ) {
-   $htmlList = '' . implode( '', array_map( function ( $item ) 
{
-   return "$item";
-   }, $expected ) ) . '';
-   array_unshift( $expected, $htmlList );
-   $this->assertSame( $expected, $actual );
+   $htmlList = '';
+   foreach ( $expected as $item ) {
+   $htmlList .= "$item";
+   }
+   $htmlList .= '';
+   $this->assertSame( $htmlList, $actual[0] );
+   $this->assertSame( $expected, array_slice( $actual, 1 ) );
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8715c3338fe0b42314639519a524c1b50896e29
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Remove not needed Statements from Multi/SingleValueChecker t...

2018-01-23 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405875 )

Change subject: Remove not needed Statements from Multi/SingleValueChecker tests
..

Remove not needed Statements from Multi/SingleValueChecker tests

Bug: T175566
Change-Id: I6802e7ecdd2638c4f0112798a6eafb57c3a5c873
---
M tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
M tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
2 files changed, 2 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/75/405875/1

diff --git a/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php 
b/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
index cfdd52d..d80e567 100644
--- a/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
+++ b/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
@@ -83,9 +83,7 @@
$statement = NewStatement::someValueFor( 'P10' )->build();
$statement->getQualifiers()->addSnak( $qualifier1 );
$statement->getQualifiers()->addSnak( $qualifier2 );
-   $item = NewItem::withStatement( $statement )
-   ->andStatement( NewStatement::someValueFor( 'P1' ) )
-   ->build();
+   $item = NewItem::withStatement( $statement )->build();
$context = new QualifierContext( $item, $statement, $qualifier1 
);
 
$checkResult = $this->checker->checkConstraint( $context, 
$this->constraint );
diff --git a/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php 
b/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
index 7d4404f..5ae7df5 100644
--- a/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
+++ b/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
@@ -83,9 +83,7 @@
$statement = NewStatement::someValueFor( 'P10' )->build();
$statement->getQualifiers()->addSnak( $qualifier1 );
$statement->getQualifiers()->addSnak( $qualifier2 );
-   $item = NewItem::withStatement( $statement )
-   ->andStatement( NewStatement::someValueFor( 'P1' ) )
-   ->build();
+   $item = NewItem::withStatement( $statement )->build();
$context = new QualifierContext( $item, $statement, $qualifier1 
);
 
$checkResult = $this->checker->checkConstraint( $context, 
$this->constraint );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6802e7ecdd2638c4f0112798a6eafb57c3a5c873
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Remove not needed …->withSomeGuid() calls from tests

2018-01-23 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405874 )

Change subject: Remove not needed …->withSomeGuid() calls from tests
..

Remove not needed …->withSomeGuid() calls from tests

These calls have been introduced with I0fced66. They do, in fact, not
make any difference. At least for now. This might change with future
patches (e.g. "upcoming changes to ValueCountCheckerHelper" have been
mentioned). I want to leave this here as a reminder to recheck when this
happened.

Bug: T168240
Change-Id: Ie5a7652d609721cf91a5619cc89b35101601dd51
---
M tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
M tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
2 files changed, 12 insertions(+), 12 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/74/405874/1

diff --git a/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php 
b/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
index cfdd52d..683b37d 100644
--- a/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
+++ b/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
@@ -44,7 +44,7 @@
}
 
public function testMultiValueConstraint_One() {
-   $statement = NewStatement::noValueFor( 'P1' 
)->withSomeGuid()->build();
+   $statement = NewStatement::noValueFor( 'P1' )->build();
$item = NewItem::withStatement( $statement )->build();
$context = new MainSnakContext( $item, $statement );
 
@@ -54,8 +54,8 @@
}
 
public function testMultiValueConstraint_Two() {
-   $statement1 = NewStatement::noValueFor( 'P1' 
)->withSomeGuid()->build();
-   $statement2 = NewStatement::noValueFor( 'P1' 
)->withSomeGuid()->build();
+   $statement1 = NewStatement::noValueFor( 'P1' )->build();
+   $statement2 = NewStatement::noValueFor( 'P1' )->build();
$item = NewItem::withStatement( $statement1 )->andStatement( 
$statement2 )->build();
$context = new MainSnakContext( $item, $statement1 );
 
@@ -65,10 +65,10 @@
}
 
public function testMultiValueConstraint_TwoButOneDeprecated() {
-   $statement1 = NewStatement::noValueFor( 'P1' 
)->withSomeGuid()->build();
+   $statement1 = NewStatement::noValueFor( 'P1' )->build();
$statement2 = NewStatement::noValueFor( 'P1' )
->withDeprecatedRank()
-   ->withSomeGuid()->build();
+   ->build();
$item = NewItem::withStatement( $statement1 )->andStatement( 
$statement2 )->build();
$context = new MainSnakContext( $item, $statement1 );
 
@@ -110,7 +110,7 @@
public function testSingleValueConstraintDeprecatedStatement() {
$statement = NewStatement::noValueFor( 'P1' )
->withDeprecatedRank()
-   ->withSomeGuid()->build();
+   ->build();
$entity = NewItem::withId( 'Q1' )
->build();
$context = new MainSnakContext( $entity, $statement );
diff --git a/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php 
b/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
index 7d4404f..6afd45d 100644
--- a/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
+++ b/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
@@ -44,7 +44,7 @@
}
 
public function testSingleValueConstraint_One() {
-   $statement = NewStatement::noValueFor( 'P1' 
)->withSomeGuid()->build();
+   $statement = NewStatement::noValueFor( 'P1' )->build();
$item = NewItem::withStatement( $statement )->build();
$context = new MainSnakContext( $item, $statement );
 
@@ -54,8 +54,8 @@
}
 
public function testSingleValueConstraint_Two() {
-   $statement1 = NewStatement::noValueFor( 'P1' 
)->withSomeGuid()->build();
-   $statement2 = NewStatement::noValueFor( 'P1' 
)->withSomeGuid()->build();
+   $statement1 = NewStatement::noValueFor( 'P1' )->build();
+   $statement2 = NewStatement::noValueFor( 'P1' )->build();
$item = NewItem::withStatement( $statement1 )->andStatement( 
$statement2 )->build();
$context = new MainSnakContext( $item, $statement1 );
 
@@ -65,10 +65,10 @@
}
 
public function testSingleValueConstraint_TwoButOneDeprecated() {
-   $statement1 = NewStatement::noValueFor( 'P1' 
)->withSomeGuid()->build();
+   $statement1 = NewStatement::noValueFor( 'P1' )->build();
$statement2 = NewStatement::noValueFor( 'P1' )
   

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Extract ConstraintParameterRendererTest::assertConstraintRep...

2018-01-23 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405872 )

Change subject: Extract 
ConstraintParameterRendererTest::assertConstraintReportParameterList
..

Extract ConstraintParameterRendererTest::assertConstraintReportParameterList

Bug: T169121
Change-Id: Ic51b3283b3419b35b4068b331d00afe3216b3835
---
M tests/phpunit/ConstraintParameterRendererTest.php
1 file changed, 34 insertions(+), 113 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/72/405872/1

diff --git a/tests/phpunit/ConstraintParameterRendererTest.php 
b/tests/phpunit/ConstraintParameterRendererTest.php
index 3af26f0..14ce764 100644
--- a/tests/phpunit/ConstraintParameterRendererTest.php
+++ b/tests/phpunit/ConstraintParameterRendererTest.php
@@ -279,7 +279,7 @@
 
$formatted = 
$constraintParameterRenderer->formatPropertyIdList( [] );
 
-   $this->assertSame( [ '' ], $formatted );
+   $this->assertConstraintReportParameterList( [], $formatted );
}
 
public function testFormatPropertyIdList_TwoPropertyIds() {
@@ -294,7 +294,7 @@
new PropertyId( 'P2' ),
] );
 
-   $this->assertSame( [ 'P1P2', 'P1', 
'P2' ], $formatted );
+   $this->assertConstraintReportParameterList( [ 'P1', 'P2' ], 
$formatted );
}
 
public function testFormatPropertyIdList_TwentyPropertyIds() {
@@ -313,25 +313,8 @@
)
);
 
-   $this->assertSame(
-   [
-   '' .
-   
'P1P2P3P4P5' .
-   
'P6P7P8P9P10' .
-   '...' .
-   '',
-   'P1',
-   'P2',
-   'P3',
-   'P4',
-   'P5',
-   'P6',
-   'P7',
-   'P8',
-   'P9',
-   'P10',
-   '...',
-   ],
+   $this->assertConstraintReportParameterList(
+   [ 'P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'P7', 'P8', 'P9', 
'P10', '...' ],
$formatted
);
}
@@ -345,7 +328,7 @@
 
$formatted = $constraintParameterRenderer->formatItemIdList( [] 
);
 
-   $this->assertSame( [ '' ], $formatted );
+   $this->assertConstraintReportParameterList( [], $formatted );
}
 
public function testFormatItemIdList_TwoItemIds() {
@@ -360,7 +343,7 @@
new ItemId( 'Q2' ),
] );
 
-   $this->assertSame( [ 'Q1Q2', 'Q1', 
'Q2' ], $formatted );
+   $this->assertConstraintReportParameterList( [ 'Q1', 'Q2' ], 
$formatted );
}
 
public function testFormatItemIdList_TwentyItemIds() {
@@ -379,25 +362,8 @@
)
);
 
-   $this->assertSame(
-   [
-   '' .
-   
'Q1Q2Q3Q4Q5' .
-   
'Q6Q7Q8Q9Q10' .
-   '...' .
-   '',
-   'Q1',
-   'Q2',
-   'Q3',
-   'Q4',
-   'Q5',
-   'Q6',
-   'Q7',
-   'Q8',
-   'Q9',
-   'Q10',
-   '...',
-   ],
+   $this->assertConstraintReportParameterList(
+   [ 'Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', 'Q7', 'Q8', 'Q9', 
'Q10', '...' ],
$formatted
);
}
@@ -411,7 +377,7 @@
 
$formatted = $constraintParameterRenderer->formatEntityIdList( 
[] );
 
-   $this->assertSame( [ '' ], $formatted );
+   $this->assertConstraintReportParameterList( [], $formatted );
}
 
public function testFormatEntityIdList_PropertyIdItemIdAndNull() {
@@ -427,7 +393,7 @@
null
] );
 
-   $this->assertSame( [ 'P1Q2', 'P1', 
'Q2' ], $formatted );
+   $this->assertConstraintReportParameterList( [ 'P1', 'Q2' ], 
$formatted );
}
 
public function testFormatEntityIdList_TwentyItemIds() {
@@ -446,25 +412,8 @@
)
);
 
-   

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Improve type hints in Checkers and remove redundant PHPDoc

2018-01-23 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405868 )

Change subject: Improve type hints in Checkers and remove redundant PHPDoc
..

Improve type hints in Checkers and remove redundant PHPDoc

The majority of this patch removes PHPDoc blocks that repeat 100%
exactly what the method header already states. But this is only minor
cleanup and not the meat of this patch.

Please also review Ie157941, which does the same in the
WikibaseQualityExternalValidation extension.

Change-Id: I7408a465e7750f0ecf4c2bb30d380a7943aecb34
---
M src/ConstraintCheck/Checker/CommonsLinkChecker.php
M src/ConstraintCheck/Checker/ConflictsWithChecker.php
M src/ConstraintCheck/Checker/DiffWithinRangeChecker.php
M src/ConstraintCheck/Checker/InverseChecker.php
M src/ConstraintCheck/Checker/ItemChecker.php
M src/ConstraintCheck/Checker/OneOfChecker.php
M src/ConstraintCheck/Checker/RangeChecker.php
M src/ConstraintCheck/Checker/SymmetricChecker.php
M src/ConstraintCheck/Checker/TargetRequiredClaimChecker.php
M src/ConstraintCheck/Checker/TypeChecker.php
M src/ConstraintCheck/Checker/ValueTypeChecker.php
M src/ConstraintCheck/Context/AbstractContext.php
M src/ConstraintCheck/Context/MainSnakContext.php
M src/ConstraintCheck/DelegatingConstraintChecker.php
M src/Specials/SpecialConstraintReport.php
15 files changed, 9 insertions(+), 94 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/68/405868/1

diff --git a/src/ConstraintCheck/Checker/CommonsLinkChecker.php 
b/src/ConstraintCheck/Checker/CommonsLinkChecker.php
index 928e257..64a84bd 100644
--- a/src/ConstraintCheck/Checker/CommonsLinkChecker.php
+++ b/src/ConstraintCheck/Checker/CommonsLinkChecker.php
@@ -36,11 +36,6 @@
 */
private $titleParser;
 
-   /**
-* @param ConstraintParameterParser $constraintParameterParser
-* @param ConstraintParameterRenderer $constraintParameterRenderer
-* @param TitleParser $titleParser
-*/
public function __construct(
ConstraintParameterParser $constraintParameterParser,
ConstraintParameterRenderer $constraintParameterRenderer,
diff --git a/src/ConstraintCheck/Checker/ConflictsWithChecker.php 
b/src/ConstraintCheck/Checker/ConflictsWithChecker.php
index 8035d09..10380d8 100644
--- a/src/ConstraintCheck/Checker/ConflictsWithChecker.php
+++ b/src/ConstraintCheck/Checker/ConflictsWithChecker.php
@@ -41,12 +41,6 @@
 */
private $constraintParameterRenderer;
 
-   /**
-* @param EntityLookup $lookup
-* @param ConstraintParameterParser $constraintParameterParser
-* @param ConnectionCheckerHelper $connectionCheckerHelper
-* @param ConstraintParameterRenderer $constraintParameterRenderer
-*/
public function __construct(
EntityLookup $lookup,
ConstraintParameterParser $constraintParameterParser,
diff --git a/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php 
b/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php
index f516bbd..1e7af11 100644
--- a/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php
+++ b/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php
@@ -43,12 +43,6 @@
 */
private $config;
 
-   /**
-* @param ConstraintParameterParser $constraintParameterParser
-* @param RangeCheckerHelper $rangeCheckerHelper
-* @param ConstraintParameterRenderer $constraintParameterRenderer
-* @param Config $config
-*/
public function __construct(
ConstraintParameterParser $constraintParameterParser,
RangeCheckerHelper $rangeCheckerHelper,
diff --git a/src/ConstraintCheck/Checker/InverseChecker.php 
b/src/ConstraintCheck/Checker/InverseChecker.php
index b600fc2..a54258d 100644
--- a/src/ConstraintCheck/Checker/InverseChecker.php
+++ b/src/ConstraintCheck/Checker/InverseChecker.php
@@ -44,12 +44,6 @@
 */
private $constraintParameterRenderer;
 
-   /**
-* @param EntityLookup $lookup
-* @param ConstraintParameterParser $constraintParameterParser
-* @param ConnectionCheckerHelper $connectionCheckerHelper
-* @param ConstraintParameterRenderer $constraintParameterRenderer
-*/
public function __construct(
EntityLookup $lookup,
ConstraintParameterParser $constraintParameterParser,
diff --git a/src/ConstraintCheck/Checker/ItemChecker.php 
b/src/ConstraintCheck/Checker/ItemChecker.php
index c085b87..cd38685 100644
--- a/src/ConstraintCheck/Checker/ItemChecker.php
+++ b/src/ConstraintCheck/Checker/ItemChecker.php
@@ -40,12 +40,6 @@
 */
private $constraintParameterRenderer;
 
-   /**
-* @param EntityLookup $lookup
-* @param ConstraintParameterParser 

[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Improve type hints in documentation

2018-01-23 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405863 )

Change subject: Improve type hints in documentation
..

Improve type hints in documentation

Change-Id: I1f235d128e3fdf1f78a66eab1b7c942a60b5897b
---
M CollectionProposals.php
M CollectionSuggest.php
M includes/MessageBoxHelper.php
3 files changed, 23 insertions(+), 51 deletions(-)


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

diff --git a/CollectionProposals.php b/CollectionProposals.php
index 177a285..a539ede 100644
--- a/CollectionProposals.php
+++ b/CollectionProposals.php
@@ -21,8 +21,6 @@
  */
 
 /**
- * class: CollectionProposals
- *
  * it needs 3 Lists:
  * - one with the bookmembers
  * - one where it can save the banned articles
@@ -39,26 +37,29 @@
 class CollectionProposals {
 
/**
-* ==
-* class attributes
-* ==
-*
-* only mLinkList and mPropList can be accessed from
-* outside the class via getLinkList() and getPropsosals()
+* @var array
 */
private $mColl;
+
+   /**
+* @var array[]
+*/
private $mPropList;
+
+   /**
+* @var array[]
+*/
private $mLinkList;
+
+   /**
+* @var string[]
+*/
private $mBanList;
 
/**
-* ==
-* constructor
-* ==
-*
 * @param array $coll the collection
-* @param array $ban the list of the banned articles
-* @param array $props the list of the proposals
+* @param string[] $ban the list of the banned articles
+* @param array[] $props the list of the proposals
 */
public function __construct( $coll, $ban, $props ) {
$this->mPropList = [];
@@ -68,13 +69,7 @@
}
 
/**
-* ==
-* public methods
-* ==
-*/
-
-   /**
-* @return array
+* @return array[]
 */
public function getLinkList() {
return $this->mLinkList;
@@ -83,7 +78,7 @@
/**
 * @param array $collection
 */
-   public function setCollection( $collection ) {
+   public function setCollection( array $collection ) {
$this->mColl = $collection;
}
 
@@ -97,7 +92,7 @@
 * @param bool $doUpdate when true, $linkList will
 *updated before calculating the proposals
 *default is true
-* @return array a 2-dimensional array that contains the proposals
+* @return array[] a 2-dimensional array that contains the proposals
 * the first dimesion is numeric, the second contains
 * 3 entries:
 * - 'name': the name of a proposed article
@@ -126,12 +121,6 @@
public function hasBans() {
return count( $this->mBanList ) > 0;
}
-
-   /**
-* ==
-* private methods
-* ==
-*/
 
private function updateLinkList() {
$this->addCollectionArticles();
@@ -200,7 +189,7 @@
 *
 * @param int $num_articles
 * @param string $wikitext article text
-* @return array with links and their weights
+* @return float[] with links and their weights
 */
private function getWeightedLinks( $num_articles, $wikitext ) {
global $wgCollectionSuggestCheapWeightThreshhold;
@@ -364,7 +353,7 @@
 * if the array doesn't contain the article
 *
 * @param string $entry an articlename
-* @param array $array to be searched, it has to 2-dimensional
+* @param array[] $array to be searched, it has to 2-dimensional
 *   the 2nd dimension needs the key 'name'
 * @return bool|int the key as integer or false
 */
diff --git a/CollectionSuggest.php b/CollectionSuggest.php
index 858e42e..c5ece82 100644
--- a/CollectionSuggest.php
+++ b/CollectionSuggest.php
@@ -21,19 +21,12 @@
  */
 
 /**
- * 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
-* 

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityExternalValidation[master]: Remove all @package documentation tags

2018-01-23 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405861 )

Change subject: Remove all @package documentation tags
..

Remove all @package documentation tags

These tags are from a time when namespaces did not existed in PHP. They
do nothing but literally repeating the namespace. Let's please get rid of
them. No other project I'm aware of uses them any more.

Change-Id: I68b9679d3cd2de7587d06f8bde1daf4cacb0f4e0
---
M api/RunCrossCheck.php
M includes/CrossCheck/Comparer/DataValueComparer.php
M includes/CrossCheck/Comparer/DataValueComparerFactory.php
M includes/CrossCheck/Comparer/DispatchingDataValueComparer.php
M includes/CrossCheck/Comparer/EntityIdValueComparer.php
M includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php
M includes/CrossCheck/Comparer/MonolingualTextValueComparer.php
M includes/CrossCheck/Comparer/MultilingualTextValueComparer.php
M includes/CrossCheck/Comparer/QuantityValueComparer.php
M includes/CrossCheck/Comparer/StringComparer.php
M includes/CrossCheck/Comparer/StringValueComparer.php
M includes/CrossCheck/Comparer/TimeValueComparer.php
M includes/CrossCheck/CrossCheckInteractor.php
M includes/CrossCheck/CrossChecker.php
M includes/CrossCheck/ReferenceChecker.php
M includes/CrossCheck/Result/ComparisonResult.php
M includes/CrossCheck/Result/CrossCheckResult.php
M includes/CrossCheck/Result/CrossCheckResultList.php
M includes/CrossCheck/Result/ReferenceResult.php
M includes/CrossCheck/ValueParser/ComparativeValueParser.php
M includes/CrossCheck/ValueParser/ComparativeValueParserFactory.php
M includes/CrossCheck/ValueParser/MultilingualTextValueParser.php
M includes/DumpMetaInformation/DumpMetaInformation.php
M includes/DumpMetaInformation/DumpMetaInformationLookup.php
M includes/DumpMetaInformation/DumpMetaInformationStore.php
M includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
M includes/ExternalDataRepo.php
M includes/ExternalValidationServices.php
M includes/Serializer/ComparisonResultSerializer.php
M includes/Serializer/CrossCheckResultListSerializer.php
M includes/Serializer/CrossCheckResultSerializer.php
M includes/Serializer/DumpMetaInformationSerializer.php
M includes/Serializer/IndexedTagsSerializer.php
M includes/Serializer/ReferenceResultSerializer.php
M includes/Serializer/SerializerFactory.php
M includes/UpdateExternalData/CsvImportSettings.php
M includes/UpdateExternalData/ExternalDataImporter.php
M maintenance/UpdateExternalData.php
38 files changed, 0 insertions(+), 41 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation
 refs/changes/61/405861/1

diff --git a/api/RunCrossCheck.php b/api/RunCrossCheck.php
index 54bd122..fab0617 100644
--- a/api/RunCrossCheck.php
+++ b/api/RunCrossCheck.php
@@ -20,7 +20,6 @@
 /**
  * API module that performs cross-checks of entities or claims.
  *
- * @package WikibaseQuality\ExternalValidation\Api
  * @author BP2014N1
  * @license GNU GPL v2+
  */
diff --git a/includes/CrossCheck/Comparer/DataValueComparer.php 
b/includes/CrossCheck/Comparer/DataValueComparer.php
index 983c7c0..c1c7b57 100644
--- a/includes/CrossCheck/Comparer/DataValueComparer.php
+++ b/includes/CrossCheck/Comparer/DataValueComparer.php
@@ -5,8 +5,6 @@
 use DataValues\DataValue;
 
 /**
- * Interface DataValueComparer
- * @package WikibaseQuality\ExternalValidation\CrossCheck\Comparer
  * @author BP2014N1
  * @license GNU GPL v2+
  */
diff --git a/includes/CrossCheck/Comparer/DataValueComparerFactory.php 
b/includes/CrossCheck/Comparer/DataValueComparerFactory.php
index d510a18..a6f4f4f 100644
--- a/includes/CrossCheck/Comparer/DataValueComparerFactory.php
+++ b/includes/CrossCheck/Comparer/DataValueComparerFactory.php
@@ -6,7 +6,6 @@
 use Wikibase\TermIndex;
 
 /**
- * @package WikibaseQuality\ExternalValidation\CrossCheck\Comparer
  * @author BP2014N1
  * @license GNU GPL v2+
  */
diff --git a/includes/CrossCheck/Comparer/DispatchingDataValueComparer.php 
b/includes/CrossCheck/Comparer/DispatchingDataValueComparer.php
index ad5e100..5078f71 100644
--- a/includes/CrossCheck/Comparer/DispatchingDataValueComparer.php
+++ b/includes/CrossCheck/Comparer/DispatchingDataValueComparer.php
@@ -6,7 +6,6 @@
 use InvalidArgumentException;
 
 /**
- * @package WikibaseQuality\ExternalValidation\CrossCheck\Comparer
  * @author BP2014N1
  * @license GNU GPL v2+
  */
diff --git a/includes/CrossCheck/Comparer/EntityIdValueComparer.php 
b/includes/CrossCheck/Comparer/EntityIdValueComparer.php
index 9eb07a1..a664f16 100644
--- a/includes/CrossCheck/Comparer/EntityIdValueComparer.php
+++ b/includes/CrossCheck/Comparer/EntityIdValueComparer.php
@@ -12,7 +12,6 @@
 
 /**
  * @fixme This class does not compares EntityIdValues!
- * @package WikibaseQuality\ExternalValidation\CrossCheck\Comparer
  * @author BP2014N1
  * @license GNU GPL v2+
  */
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: [WIP] Update Wikibase CodeSniffer to 0.3.x

2018-01-22 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405735 )

Change subject: [WIP] Update Wikibase CodeSniffer to 0.3.x
..

[WIP] Update Wikibase CodeSniffer to 0.3.x

The only controversial detail I can see for now is if we really want
a sniff that disallows "list ()" with a space. Personally I don't mind.
Please state your opionin at
https://github.com/wmde/WikibaseCodeSniffer/pull/18

Change-Id: I7f9c192cb51057685e0d67742bb8446d995308a8
---
R client/tests/phpunit/includes/Hooks/BaseTemplateAfterPortletHandlerTest.php
M composer.json
M phpcs.xml
M repo/includes/Api/EntitySearchTermIndex.php
M repo/tests/phpunit/includes/Api/EditEntityTest.php
M repo/tests/phpunit/includes/Api/SetAliasesTest.php
M repo/tests/phpunit/includes/Api/SetDescriptionTest.php
M repo/tests/phpunit/includes/Api/SetLabelTest.php
M repo/tests/phpunit/includes/Api/SetSiteLinkTest.php
9 files changed, 22 insertions(+), 18 deletions(-)


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

diff --git 
a/client/tests/phpunit/includes/Hooks/BaseTemplateAfterPortalHandlerTest.php 
b/client/tests/phpunit/includes/Hooks/BaseTemplateAfterPortletHandlerTest.php
similarity index 100%
rename from 
client/tests/phpunit/includes/Hooks/BaseTemplateAfterPortalHandlerTest.php
rename to 
client/tests/phpunit/includes/Hooks/BaseTemplateAfterPortletHandlerTest.php
diff --git a/composer.json b/composer.json
index df88468..5fda6e4 100644
--- a/composer.json
+++ b/composer.json
@@ -39,7 +39,7 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": ">=0.3 <0.10",
-   "wikibase/wikibase-codesniffer": "^0.2.0",
+   "wikibase/wikibase-codesniffer": "^0.3.0",
"jakub-onderka/php-console-highlighter": "0.3.2",
"mediawiki/minus-x": "0.2.1"
},
diff --git a/phpcs.xml b/phpcs.xml
index 757ccc1..d1f49f3 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,8 +1,6 @@
 
-
-   
-
-   
+
+   
 


@@ -17,7 +15,14 @@

WikibaseClient\.example\.php

-   
+   
+   /maintenance/
+   build/generateAutoload\.php
+   
repo/tests/testDispatchCoordinator\.php
+   
+   Wikibase*\.hooks\.php
+   
+   

Scribunto_LuaWikibaseLibraryTestCase


@@ -26,8 +31,6 @@

Scribunto_LuaWikibase*Library

-
-   
 


@@ -39,6 +42,7 @@

 
.
+   repo/tests/browser

view/lib/wikibase-api/WikibaseJavaScriptApi.php
^extensions/
 
diff --git a/repo/includes/Api/EntitySearchTermIndex.php 
b/repo/includes/Api/EntitySearchTermIndex.php
index 1cff8f2..48f2525 100644
--- a/repo/includes/Api/EntitySearchTermIndex.php
+++ b/repo/includes/Api/EntitySearchTermIndex.php
@@ -198,7 +198,7 @@
 
// NOTE: this assumes entities of the particular type are only 
provided by a single repository
// This assumption is currently valid but might change in the 
future.
-   list ( $repositoryPrefix, ) = 
$this->entityTypeToRepositoryMapping[$entityType][0];
+   list( $repositoryPrefix, ) = 
$this->entityTypeToRepositoryMapping[$entityType][0];
 
try {
$id = $this->idParser->parse( 
EntityId::joinSerialization( [
diff --git a/repo/tests/phpunit/includes/Api/EditEntityTest.php 
b/repo/tests/phpunit/includes/Api/EditEntityTest.php
index 94287c0..e2ac3a5 100644
--- a/repo/tests/phpunit/includes/Api/EditEntityTest.php
+++ b/repo/tests/phpunit/includes/Api/EditEntityTest.php
@@ -485,7 +485,7 @@
  'new' => 'item',
  'data' =>
  
'{"labels":{"en":{"language":"en","value":"something"}}}' ];
-   list ( $result, ) = $this->doApiRequestWithToken( 
$createItemParams, null, $user );
+   list( $result, ) = $this->doApiRequestWithToken( 
$createItemParams, null, $user );
return $result['entity'];
}
 
diff --git a/repo/tests/phpunit/includes/Api/SetAliasesTest.php 
b/repo/tests/phpunit/includes/Api/SetAliasesTest.php
index 33cf152..e01cbb8 100644
--- a/repo/tests/phpunit/includes/Api/SetAliasesTest.php
+++ b/repo/tests/phpunit/includes/Api/SetAliasesTest.php
@@ -273,7 +273,7 @@
 
$newItem = $this->createItemUsing( $userWithAllPermissions );
 
-   list ( $result, ) = $this->doApiRequestWithToken(
+   list( $result, ) = $this->doApiRequestWithToken(
$this->getAddAliasRequestParams( $newItem->getId() ),
null,
$userWithAllPermissions

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Mark all Lexeme API modules as "internal"

2018-01-22 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405732 )

Change subject: Mark all Lexeme API modules as "internal"
..

Mark all Lexeme API modules as "internal"

MediaWiki core does have an other idea of what "internal" means than
the team developing the Lexeme codebase does. For core, "internal" is
nothing but a message on the help page for the API module. This does not
hide the module in any way.

Change-Id: I29720dd35204384ee44dfa441e7b65d264bbdd62
---
M src/Api/AddForm.php
M src/Api/EditFormElements.php
2 files changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/32/405732/1

diff --git a/src/Api/AddForm.php b/src/Api/AddForm.php
index 0cec37a..4a84036 100644
--- a/src/Api/AddForm.php
+++ b/src/Api/AddForm.php
@@ -238,6 +238,14 @@
}
 
/**
+* As long as this codebase is in development and APIs might change any 
time without notice, we
+* mark all as internal. This adds an "unstable" notice, but does not 
hide them in any way.
+*/
+   public function isInternal() {
+   return true;
+   }
+
+   /**
 * @see ApiBase::needsToken()
 */
public function needsToken() {
diff --git a/src/Api/EditFormElements.php b/src/Api/EditFormElements.php
index 5eb2068..7a9f1bd 100644
--- a/src/Api/EditFormElements.php
+++ b/src/Api/EditFormElements.php
@@ -196,6 +196,14 @@
}
 
/**
+* As long as this codebase is in development and APIs might change any 
time without notice, we
+* mark all as internal. This adds an "unstable" notice, but does not 
hide them in any way.
+*/
+   public function isInternal() {
+   return true;
+   }
+
+   /**
 * @see ApiBase::needsToken()
 */
public function needsToken() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29720dd35204384ee44dfa441e7b65d264bbdd62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Fix incomplete Form diffing not covering adding/removal of F...

2018-01-22 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405697 )

Change subject: Fix incomplete Form diffing not covering adding/removal of Forms
..

Fix incomplete Form diffing not covering adding/removal of Forms

Forms can not only change, Forms can also be added and removed. This
was just not covered by the code yet. The diff failed hard with quite
extreme exceptions.

This becomes obvious very easily if you try to compare two different
Lexemes, e.g. …?oldid=…=… with two revision IDs from two different
Lexemes. (Which is a quite typical use case, e.g. if two entities are
duplicates and the user wants to compare the two.)

Bug: T185477
Change-Id: I9ba8622f5b060d76a7915d9bd74383b39d76fb3f
---
M src/DataModel/Services/Diff/FormDiffer.php
M src/DataModel/Services/Diff/LexemeDiffer.php
M src/Diff/FormDiffView.php
3 files changed, 58 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/97/405697/1

diff --git a/src/DataModel/Services/Diff/FormDiffer.php 
b/src/DataModel/Services/Diff/FormDiffer.php
index f869063..6f2fa4e 100644
--- a/src/DataModel/Services/Diff/FormDiffer.php
+++ b/src/DataModel/Services/Diff/FormDiffer.php
@@ -4,13 +4,15 @@
 
 use Diff\Differ\MapDiffer;
 use Diff\DiffOp\Diff\Diff;
-use DomainException;
 use InvalidArgumentException;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Services\Diff\EntityDiff;
 use Wikibase\DataModel\Services\Diff\EntityDifferStrategy;
 use Wikibase\DataModel\Services\Diff\StatementListDiffer;
+use Wikibase\DataModel\Term\Term;
+use Wikibase\DataModel\Term\TermList;
 use Wikibase\Lexeme\DataModel\Form;
+use Wikibase\Lexeme\DataModel\FormId;
 
 /**
  * @license GPL-2.0+
@@ -42,8 +44,8 @@
}
 
/**
-* @param EntityDocument $from
-* @param EntityDocument $to
+* @param Form $from
+* @param Form $to
 *
 * @return EntityDiff
 * @throws InvalidArgumentException
@@ -57,30 +59,40 @@
}
 
/**
-* @param EntityDocument $entity
+* @param Form $form
 *
 * @return EntityDiff
 * @throws InvalidArgumentException
 */
-   public function getConstructionDiff( EntityDocument $entity ) {
-   throw new DomainException( 'Forms aren\'t stored as separate 
wiki pages, and can only show '
-   . 'up in regular diffs that add or remove a Form' );
+   public function getConstructionDiff( EntityDocument $form ) {
+   if ( !( $form instanceof Form ) ) {
+   throw new InvalidArgumentException( 'Can only diff 
Forms' );
+   }
+
+   return $this->diff( $this->newEmptyForm( $form->getId() ), 
$form );
}
 
/**
-* @param EntityDocument $entity
+* @param Form $form
 *
 * @return EntityDiff
 * @throws InvalidArgumentException
 */
-   public function getDestructionDiff( EntityDocument $entity ) {
-   throw new DomainException( 'Forms aren\'t stored as separate 
wiki pages, and can only show '
-   . 'up in regular diffs that add or remove a Form' );
+   public function getDestructionDiff( EntityDocument $form ) {
+   if ( !( $form instanceof Form ) ) {
+   throw new InvalidArgumentException( 'Can only diff 
Forms' );
+   }
+
+   return $this->diff( $form, $this->newEmptyForm( $form->getId() 
) );
+   }
+
+   private function newEmptyForm( FormId $id ) {
+   $form = new Form( $id, new TermList( [ new Term( 'dummy', 
'dummy' ) ] ), [] );
+   $form->getRepresentations()->clear();
+   return $form;
}
 
/**
-* @deprecated use self::diffEntities instead
-*
 * @param Form $old
 * @param Form $new
 *
diff --git a/src/DataModel/Services/Diff/LexemeDiffer.php 
b/src/DataModel/Services/Diff/LexemeDiffer.php
index 1494c7e..e59fdce 100644
--- a/src/DataModel/Services/Diff/LexemeDiffer.php
+++ b/src/DataModel/Services/Diff/LexemeDiffer.php
@@ -4,7 +4,10 @@
 
 use Diff\Differ\MapDiffer;
 use Diff\DiffOp\Diff\Diff;
+use Diff\DiffOp\DiffOpAdd;
 use Diff\DiffOp\DiffOpChange;
+use Diff\DiffOp\DiffOpRemove;
+use LogicException;
 use UnexpectedValueException;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Services\Diff\EntityDiff;
@@ -153,7 +156,7 @@
 * @param FormSet $from
 * @param FormSet $to
 *
-* @return Diff;
+* @return Diff
 */
private function getFormsDiff( FormSet $from, FormSet $to ) {
$differ = new MapDiffer();
@@ -167,13 +170,28 @@
$formDiffOps = $differ->doDiff( $from, $to );
 
foreach ( $formDiffOps as 

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Fix violation of using package private serializer implementa...

2018-01-22 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405689 )

Change subject: Fix violation of using package private serializer 
implementations
..

Fix violation of using package private serializer implementations

These two implementations are marked as "package private", which means
it is actually forbidden to instantiate or use them in any way that
sidesteps the public methods provided by the serializer factory.

This is not some personal opinion or anything I came up with, but
clearly marked in the contract of the Wikibase DataModel Serialization
component.

Bug: T178994
Change-Id: I4cb1591c626c4b0a8b6b32a4dc1da7244baa3c5a
---
M src/DataModel/Serialization/FormSerializer.php
M 
tests/phpunit/composer/DataModel/Serialization/ExternalLexemeSerializerTest.php
M tests/phpunit/composer/DataModel/Serialization/StorageLexemeSerializerTest.php
3 files changed, 9 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/89/405689/1

diff --git a/src/DataModel/Serialization/FormSerializer.php 
b/src/DataModel/Serialization/FormSerializer.php
index e7350b5..facc3cc 100644
--- a/src/DataModel/Serialization/FormSerializer.php
+++ b/src/DataModel/Serialization/FormSerializer.php
@@ -2,9 +2,8 @@
 
 namespace Wikibase\Lexeme\DataModel\Serialization;
 
+use Serializers\Serializer;
 use Wikibase\DataModel\Entity\ItemId;
-use Wikibase\DataModel\Serializers\StatementListSerializer;
-use Wikibase\DataModel\Serializers\TermListSerializer;
 use Wikibase\Lexeme\DataModel\Form;
 
 /**
@@ -13,18 +12,18 @@
 class FormSerializer {
 
/**
-* @var TermListSerializer
+* @var Serializer
 */
private $termListSerializer;
 
/**
-* @var StatementListSerializer
+* @var Serializer
 */
private $statementListSerializer;
 
public function __construct(
-   TermListSerializer $termListSerializer,
-   StatementListSerializer $statementListSerializer
+   Serializer $termListSerializer,
+   Serializer $statementListSerializer
) {
$this->termListSerializer = $termListSerializer;
$this->statementListSerializer = $statementListSerializer;
diff --git 
a/tests/phpunit/composer/DataModel/Serialization/ExternalLexemeSerializerTest.php
 
b/tests/phpunit/composer/DataModel/Serialization/ExternalLexemeSerializerTest.php
index d71a3b2..898e263 100644
--- 
a/tests/phpunit/composer/DataModel/Serialization/ExternalLexemeSerializerTest.php
+++ 
b/tests/phpunit/composer/DataModel/Serialization/ExternalLexemeSerializerTest.php
@@ -4,10 +4,9 @@
 
 use PHPUnit_Framework_TestCase;
 use Serializers\Exceptions\SerializationException;
+use Serializers\Serializer;
 use Wikibase\DataModel\Entity\Item;
 use Wikibase\DataModel\Entity\PropertyId;
-use Wikibase\DataModel\Serializers\StatementListSerializer;
-use Wikibase\DataModel\Serializers\TermListSerializer;
 use Wikibase\DataModel\Snak\PropertyNoValueSnak;
 use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\DataModel\Term\TermList;
@@ -27,17 +26,13 @@
 class ExternalLexemeSerializerTest extends PHPUnit_Framework_TestCase {
 
private function newSerializer() {
-   $statementListSerializer = $this->getMockBuilder( 
StatementListSerializer::class )
-   ->disableOriginalConstructor()
-   ->getMock();
+   $statementListSerializer = $this->getMock( Serializer::class );
$statementListSerializer->method( 'serialize' )
->will( $this->returnCallback( function ( StatementList 
$statementList ) {
return implode( '|', 
$statementList->getPropertyIds() );
} ) );
 
-   $termListSerializer = $this->getMockBuilder( 
TermListSerializer::class )
-   ->disableOriginalConstructor()
-   ->getMock();
+   $termListSerializer = $this->getMock( Serializer::class );
$termListSerializer->method( 'serialize' )
->will( $this->returnCallback( function ( TermList 
$termList ) {
return $termList->toTextArray();
diff --git 
a/tests/phpunit/composer/DataModel/Serialization/StorageLexemeSerializerTest.php
 
b/tests/phpunit/composer/DataModel/Serialization/StorageLexemeSerializerTest.php
index 1648362..2b48efe 100644
--- 
a/tests/phpunit/composer/DataModel/Serialization/StorageLexemeSerializerTest.php
+++ 
b/tests/phpunit/composer/DataModel/Serialization/StorageLexemeSerializerTest.php
@@ -13,7 +13,6 @@
 use Wikibase\DataModel\Entity\EntityIdValue;
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\PropertyId;
-use Wikibase\DataModel\Serializers\TermListSerializer;
 use 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Update license to use "GPL-2.0-or-later"

2018-01-19 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405315 )

Change subject: Update license to use "GPL-2.0-or-later"
..

Update license to use "GPL-2.0-or-later"

Packagist starts to complain about this. I know there is more (actually
2000+ mentions of "GPL-2.0+"), but let's start as trivial as possible.

Change-Id: Id54646e51868bc1ee533dbc7ec08a4a4e275c019
---
M composer.json
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/composer.json b/composer.json
index 9816a07..ec40562 100644
--- a/composer.json
+++ b/composer.json
@@ -10,7 +10,7 @@
"wikibaserepo"
],
"homepage": "http://wikiba.se;,
-   "license": "GPL-2.0+",
+   "license": "GPL-2.0-or-later",
"authors": [
{
"name": "The Wikidata team"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id54646e51868bc1ee533dbc7ec08a4a4e275c019
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Fix mistakes and refactor FormDiffView and related

2018-01-12 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403969 )

Change subject: Fix mistakes and refactor FormDiffView and related
..

Fix mistakes and refactor FormDiffView and related

I believe this is all very much trivial refactoring. This patch also
fixes a few mistakes, but these happened in comments.

Bug: T182424
Change-Id: I4e6b9531d56405e8d2c72d501c322ab71e6ead29
---
M src/Diff/FormDiffView.php
M src/Diff/LexemeDiffVisualizer.php
M tests/phpunit/mediawiki/Diff/FormDiffViewTest.php
3 files changed, 54 insertions(+), 60 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/69/403969/1

diff --git a/src/Diff/FormDiffView.php b/src/Diff/FormDiffView.php
index 1d82223..38c46e8 100644
--- a/src/Diff/FormDiffView.php
+++ b/src/Diff/FormDiffView.php
@@ -22,12 +22,12 @@
 class FormDiffView extends BasicDiffView {
 
/**
-* @var ClaimDiffer|null
+* @var ClaimDiffer
 */
private $claimDiffer;
 
/**
-* @var ClaimDifferenceVisualizer|null
+* @var ClaimDifferenceVisualizer
 */
private $claimDiffVisualizer;
 
@@ -61,26 +61,29 @@
 * @param string[] $path
 * @param DiffOp $op
 *
-* @return string
-* @throws MWException
+* @return string HTML
 */
protected function generateOpHtml( array $path, DiffOp $op ) {
-   $html = '';
if ( $op->isAtomic() ) {
return parent::generateOpHtml( $path, $op );
}
+
+   $html = '';
+
foreach ( $op as $key => $subOp ) {
-   if ( !$subOp instanceof ChangeFormDiffOp ) {
-   $html .= $this->generateOpHtml( array_merge( 
$path, [ $key ] ), $subOp );
-   } else {
+   if ( $subOp instanceof ChangeFormDiffOp ) {
$html .= $this->generateFormOpHtml( $path, 
$subOp, $key );
+   } else {
+   $html .= $this->generateOpHtml( array_merge( 
$path, [ $key ] ), $subOp );
}
}
+
return $html;
}
 
-   private function generateFormOpHtml( $path, ChangeFormDiffOp $op, $key 
) {
+   private function generateFormOpHtml( array $path, ChangeFormDiffOp $op, 
$key ) {
$html = '';
+
foreach ( $op->getStatementsDiffOps() as $claimDiffOp ) {
$html .= $this->getClaimDiffHtml(
$claimDiffOp,
@@ -108,33 +111,31 @@
}
 
/**
-* @param DiffOp $claimDiffOp
+* @param DiffOp $diffOp
 *
 * @return string HTML
 * @throws MWException
 */
-   protected function getClaimDiffHtml( DiffOp $claimDiffOp, array $path ) 
{
-   if ( $claimDiffOp instanceof DiffOpChange ) {
-   $claimDifference = $this->claimDiffer->diffClaims(
-   $claimDiffOp->getOldValue(),
-   $claimDiffOp->getNewValue()
-   );
-   return $this->claimDiffVisualizer->visualizeClaimChange(
-   $claimDifference,
-   $claimDiffOp->getNewValue(),
-   $path
-   );
-   }
+   private function getClaimDiffHtml( DiffOp $diffOp, array $path ) {
+   switch ( true ) {
+   case $diffOp instanceof DiffOpChange:
+   return 
$this->claimDiffVisualizer->visualizeClaimChange(
+   $this->claimDiffer->diffClaims(
+   $diffOp->getOldValue(),
+   $diffOp->getNewValue()
+   ),
+   $diffOp->getNewValue(),
+   $path
+   );
 
-   if ( $claimDiffOp instanceof DiffOpAdd ) {
-   return $this->claimDiffVisualizer->visualizeNewClaim( 
$claimDiffOp->getNewValue(), $path );
-   } elseif ( $claimDiffOp instanceof DiffOpRemove ) {
-   return 
$this->claimDiffVisualizer->visualizeRemovedClaim(
-   $claimDiffOp->getOldValue(),
-   $path
-   );
-   } else {
-   throw new MWException( 'Encountered an unexpected diff 
operation type for a claim' );
+   case $diffOp instanceof DiffOpAdd:
+   return 
$this->claimDiffVisualizer->visualizeNewClaim( 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Move path array prepending logic to ClaimDifferenceVisualizer

2018-01-12 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403963 )

Change subject: Move path array prepending logic to ClaimDifferenceVisualizer
..

Move path array prepending logic to ClaimDifferenceVisualizer

With this patch I am making the prepended path a private implementation
detail of the ClaimDifferenceVisualizer class, and remove it entirely
from DifferencesSnakVisualizer where it was before. That solves all
concerns I had with the original patch Ia4bebd8:

* The $path is not passed so deeply into code that does not really need
  to know anything about it.
* Many of the optional $path parameters are gone.

I had multiple reason to do it this way and would like to explain them,
if needed.

One reason is that a method called "getPropertyHeader" should only do
exactly that: return the substring that describes a property.

Note this patch does not change anything that is needed for I50eb048.
The code I am touching in this patch is not used outside of the
Wikibase code base.

Bug: T182424
Change-Id: I0408672f42b9822f0fe380d8f692b15a7d64f73d
---
M repo/includes/Diff/ClaimDifferenceVisualizer.php
M repo/includes/Diff/DifferencesSnakVisualizer.php
M repo/tests/phpunit/includes/Diff/DifferencesSnakVisualizerTest.php
3 files changed, 54 insertions(+), 57 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/63/403963/1

diff --git a/repo/includes/Diff/ClaimDifferenceVisualizer.php 
b/repo/includes/Diff/ClaimDifferenceVisualizer.php
index d75f9a6..ab9 100644
--- a/repo/includes/Diff/ClaimDifferenceVisualizer.php
+++ b/repo/includes/Diff/ClaimDifferenceVisualizer.php
@@ -55,6 +55,7 @@
Statement $baseStatement,
array $path = []
) {
+   $headerPrefix = implode( ' / ', $path ) . ' / ';
$newestMainSnak = $baseStatement->getMainSnak();
$oldestMainSnak = $newestMainSnak;
$html = '';
@@ -63,40 +64,40 @@
if ( $mainSnakChange !== null ) {
$oldestMainSnak = $mainSnakChange->getOldValue() ?: 
$newestMainSnak;
$html .= $this->visualizeMainSnakChange(
+   $headerPrefix,
$mainSnakChange,
$oldestMainSnak,
-   $newestMainSnak,
-   $path
+   $newestMainSnak
);
}
 
$rankChange = $claimDifference->getRankChange();
if ( $rankChange !== null ) {
$html .= $this->visualizeRankChange(
+   $headerPrefix,
$rankChange,
$oldestMainSnak,
-   $newestMainSnak,
-   $path
+   $newestMainSnak
);
}
 
$qualifierChanges = $claimDifference->getQualifierChanges();
if ( $qualifierChanges !== null ) {
$html .= $this->visualizeQualifierChanges(
+   $headerPrefix,
$qualifierChanges,
$oldestMainSnak,
-   $newestMainSnak,
-   $path
+   $newestMainSnak
);
}
 
$referenceChanges = $claimDifference->getReferenceChanges();
if ( $referenceChanges !== null ) {
$html .= $this->visualizeReferenceChanges(
+   $headerPrefix,
$referenceChanges,
$oldestMainSnak,
-   $newestMainSnak,
-   $path
+   $newestMainSnak
);
}
 
@@ -132,22 +133,22 @@
}
 
/**
+* @param string $headerPrefix
 * @param DiffOpChange $mainSnakChange
 * @param Snak $oldestMainSnak The old main snak, if present; 
otherwise, the new main snak
 * @param Snak $newestMainSnak The new main snak, if present; 
otherwise, the old main snak
-* @param string[] $path The path to prepend in the header
 *
 * @return string HTML
 */
private function visualizeMainSnakChange(
+   $headerPrefix,
DiffOpChange $mainSnakChange,
Snak $oldestMainSnak,
-   Snak $newestMainSnak,
-   array $path
+   Snak $newestMainSnak
) {
$valueFormatter = new DiffOpValueFormatter(
-   

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Remove PHPDoc blocks that just repeat the method header

2018-01-12 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403955 )

Change subject: Remove PHPDoc blocks that just repeat the method header
..

Remove PHPDoc blocks that just repeat the method header

Such comments do not add any new information.

Change-Id: Ib4e529310ef66d36b6909fff7d1b07afd53a3fe8
---
M src/DataModel/Lexeme.php
M src/Rdf/LexemeRdfBuilder.php
M tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php
3 files changed, 1 insertion(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/55/403955/1

diff --git a/src/DataModel/Lexeme.php b/src/DataModel/Lexeme.php
index 2b64c7d..cc173be 100644
--- a/src/DataModel/Lexeme.php
+++ b/src/DataModel/Lexeme.php
@@ -208,9 +208,6 @@
return $this->lemmas;
}
 
-   /**
-* @param TermList $lemmas
-*/
public function setLemmas( TermList $lemmas ) {
$this->lemmas = $lemmas;
}
@@ -228,9 +225,6 @@
return $this->lexicalCategory;
}
 
-   /**
-* @param ItemId $lexicalCategory
-*/
public function setLexicalCategory( ItemId $lexicalCategory ) {
$this->lexicalCategory = $lexicalCategory;
}
@@ -248,9 +242,6 @@
return $this->language;
}
 
-   /**
-* @param ItemId $language
-*/
public function setLanguage( ItemId $language ) {
$this->language = $language;
}
diff --git a/src/Rdf/LexemeRdfBuilder.php b/src/Rdf/LexemeRdfBuilder.php
index 476268e..bedb8c6 100644
--- a/src/Rdf/LexemeRdfBuilder.php
+++ b/src/Rdf/LexemeRdfBuilder.php
@@ -27,14 +27,7 @@
 */
private $writer;
 
-   /**
-* @param RdfVocabulary $vocabulary
-* @param RdfWriter $writer
-*/
-   public function __construct(
-   RdfVocabulary $vocabulary,
-   RdfWriter $writer
-   ) {
+   public function __construct( RdfVocabulary $vocabulary, RdfWriter 
$writer ) {
$this->vocabulary = $vocabulary;
$this->writer = $writer;
}
diff --git 
a/tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php 
b/tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php
index a6aba3c..5d4939e 100644
--- a/tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php
+++ b/tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php
@@ -163,10 +163,6 @@
$this->assertEquals( [], $form1->getGrammaticalFeatures() );
}
 
-   /**
-* @param ItemId $gf
-* @param Form $form
-*/
private function assertHasGrammaticalFeature( ItemId $gf, Form $form ) {
$this->assertContains(
$gf,
@@ -178,10 +174,6 @@
);
}
 
-   /**
-* @param ItemId $gf
-* @param Form $form
-*/
private function assertDoentHaveGrammaticalFeature( ItemId $gf, Form 
$form ) {
$this->assertNotContains(
$gf,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4e529310ef66d36b6909fff7d1b07afd53a3fe8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Improve type hints and remove 100% redundant PHPDoc blocks

2018-01-12 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403954 )

Change subject: Improve type hints and remove 100% redundant PHPDoc blocks
..

Improve type hints and remove 100% redundant PHPDoc blocks

The main reason for this patch are the missing type hints and & I am
adding in certain places.

I'm also removing PHPDoc block that repeat 100% exactly what the method
header already states. We already did this once, that's why only a few
of such comment blocks could be found for this patch.

Change-Id: I222660937fc7f3ce6a0ea5fbf7198199d6b08bef
---
M client/WikibaseClient.hooks.php
M client/includes/Changes/InjectRCRecordsJob.php
M client/includes/Hooks/ChangesListLinesHandler.php
M client/includes/Hooks/NoLangLinkHandler.php
M client/includes/Serializer/ClientStatementListSerializer.php
M client/includes/Usage/UsageTrackingSnakFormatter.php
M lib/includes/Store/CacheRetrievingEntityRevisionLookup.php
M lib/includes/Store/CachingEntityRevisionLookup.php
M repo/Wikibase.hooks.php
M repo/includes/Diff/DispatchingEntityDiffVisualizer.php
M repo/includes/EditEntityFactory.php
M repo/includes/Rdf/Values/ExternalIdentifierRdfBuilder.php
M repo/includes/WikibaseRepo.php
M repo/tests/phpunit/includes/Store/MockEntityIdPager.php
14 files changed, 12 insertions(+), 71 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/54/403954/1

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index b53ef3c..1176ab4 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -238,7 +238,7 @@
/**
 * Register the parser functions.
 *
-* @param Parser $parser
+* @param Parser &$parser
 *
 * @return bool
 */
diff --git a/client/includes/Changes/InjectRCRecordsJob.php 
b/client/includes/Changes/InjectRCRecordsJob.php
index 545fdd2..021b3ef 100644
--- a/client/includes/Changes/InjectRCRecordsJob.php
+++ b/client/includes/Changes/InjectRCRecordsJob.php
@@ -159,30 +159,18 @@
$this->logger = new NullLogger();
}
 
-   /**
-* @param RecentChangesDuplicateDetector $rcDuplicateDetector
-*/
public function setRecentChangesDuplicateDetector( 
RecentChangesDuplicateDetector $rcDuplicateDetector ) {
$this->rcDuplicateDetector = $rcDuplicateDetector;
}
 
-   /**
-* @param TitleFactory $titleFactory
-*/
public function setTitleFactory( TitleFactory $titleFactory ) {
$this->titleFactory = $titleFactory;
}
 
-   /**
-* @param LoggerInterface $logger
-*/
public function setLogger( LoggerInterface $logger ) {
$this->logger = $logger;
}
 
-   /**
-* @param StatsdDataFactoryInterface $stats
-*/
public function setStats( StatsdDataFactoryInterface $stats ) {
$this->stats = $stats;
}
diff --git a/client/includes/Hooks/ChangesListLinesHandler.php 
b/client/includes/Hooks/ChangesListLinesHandler.php
index 73d69c3..fb05c83 100644
--- a/client/includes/Hooks/ChangesListLinesHandler.php
+++ b/client/includes/Hooks/ChangesListLinesHandler.php
@@ -65,7 +65,7 @@
 * @param ChangesList $changesList
 * @return self
 */
-   private static function getInstance( $changesList ) {
+   private static function getInstance( ChangesList $changesList ) {
if ( self::$instance === null ) {
self::$instance = self::newFromGlobalState( 
$changesList );
}
diff --git a/client/includes/Hooks/NoLangLinkHandler.php 
b/client/includes/Hooks/NoLangLinkHandler.php
index 3675d91..f6b8f90 100644
--- a/client/includes/Hooks/NoLangLinkHandler.php
+++ b/client/includes/Hooks/NoLangLinkHandler.php
@@ -30,7 +30,7 @@
 *
 * @return string
 */
-   public static function handle( &$parser /*...*/ ) {
+   public static function handle( Parser &$parser /*...*/ ) {
$langs = func_get_args();
 
// Remove the first member, which is the parser.
@@ -88,12 +88,12 @@
/**
 * Parser function
 *
-* @param Parser &$parser
+* @param Parser $parser
 * @param string[] $langs
 *
 * @return string
 */
-   public function doHandle( &$parser, array $langs ) {
+   public function doHandle( Parser $parser, array $langs ) {
if ( !$this->namespaceChecker->isWikibaseEnabled( 
$parser->getTitle()->getNamespace() ) ) {
// shorten out
return '';
diff --git a/client/includes/Serializer/ClientStatementListSerializer.php 
b/client/includes/Serializer/ClientStatementListSerializer.php
index 00440c1..8cab514 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityExternalValidation[master]: Improve type hints in CrossCheckerTest and remove redundant ...

2018-01-12 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403953 )

Change subject: Improve type hints in CrossCheckerTest and remove redundant 
PHPDoc
..

Improve type hints in CrossCheckerTest and remove redundant PHPDoc

The majority of this patch removes PHPDoc blocks that repeat 100%
exactly what the method header already states. But this is only minor
cleanup and not the meat of this patch.

Change-Id: Ie1579418191098f48cca32de941da9bdf6d4c05a
---
M includes/CrossCheck/Comparer/DataValueComparerFactory.php
M includes/CrossCheck/Comparer/EntityIdValueComparer.php
M includes/CrossCheck/Comparer/MonolingualTextValueComparer.php
M includes/CrossCheck/Comparer/MultilingualTextValueComparer.php
M includes/CrossCheck/Comparer/StringComparer.php
M includes/CrossCheck/Comparer/StringValueComparer.php
M includes/CrossCheck/CrossCheckInteractor.php
M includes/CrossCheck/CrossChecker.php
M includes/CrossCheck/ValueParser/MultilingualTextValueParser.php
M includes/CrossCheck/ValueParser/StringValueParser.php
M includes/DumpMetaInformation/SqlDumpMetaInformationRepo.php
M includes/Serializer/ComparisonResultSerializer.php
M includes/Serializer/CrossCheckResultListSerializer.php
M includes/Serializer/CrossCheckResultSerializer.php
M includes/Serializer/ReferenceResultSerializer.php
M includes/Serializer/SerializerFactory.php
M includes/UpdateExternalData/ExternalDataImporter.php
M specials/SpecialCrossCheck.php
M specials/SpecialExternalDatabases.php
M tests/phpunit/CrossCheck/CrossCheckerTest.php
20 files changed, 17 insertions(+), 97 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation
 refs/changes/53/403953/1

diff --git a/includes/CrossCheck/Comparer/DataValueComparerFactory.php 
b/includes/CrossCheck/Comparer/DataValueComparerFactory.php
index d510a18..7d98ec5 100644
--- a/includes/CrossCheck/Comparer/DataValueComparerFactory.php
+++ b/includes/CrossCheck/Comparer/DataValueComparerFactory.php
@@ -22,10 +22,6 @@
 */
private $stringNormalizer;
 
-   /**
-* @param TermIndex $termIndex
-* @param StringNormalizer $stringNormalizer
-*/
public function __construct( TermIndex $termIndex, StringNormalizer 
$stringNormalizer ) {
$this->termIndex = $termIndex;
$this->stringNormalizer = $stringNormalizer;
diff --git a/includes/CrossCheck/Comparer/EntityIdValueComparer.php 
b/includes/CrossCheck/Comparer/EntityIdValueComparer.php
index 9eb07a1..3a2fc72 100644
--- a/includes/CrossCheck/Comparer/EntityIdValueComparer.php
+++ b/includes/CrossCheck/Comparer/EntityIdValueComparer.php
@@ -28,10 +28,6 @@
 */
private $stringComparer;
 
-   /**
-* @param TermIndex $termIndex
-* @param StringComparer $stringComparer
-*/
public function __construct( TermIndex $termIndex, StringComparer 
$stringComparer ) {
$this->termIndex = $termIndex;
$this->stringComparer = $stringComparer;
diff --git a/includes/CrossCheck/Comparer/MonolingualTextValueComparer.php 
b/includes/CrossCheck/Comparer/MonolingualTextValueComparer.php
index 29451d4..c64c0cc 100644
--- a/includes/CrossCheck/Comparer/MonolingualTextValueComparer.php
+++ b/includes/CrossCheck/Comparer/MonolingualTextValueComparer.php
@@ -18,9 +18,6 @@
 */
private $stringComparer;
 
-   /**
-* @param StringComparer $stringComparer
-*/
public function __construct( StringComparer $stringComparer ) {
$this->stringComparer = $stringComparer;
}
diff --git a/includes/CrossCheck/Comparer/MultilingualTextValueComparer.php 
b/includes/CrossCheck/Comparer/MultilingualTextValueComparer.php
index bdec056..ae95de4 100644
--- a/includes/CrossCheck/Comparer/MultilingualTextValueComparer.php
+++ b/includes/CrossCheck/Comparer/MultilingualTextValueComparer.php
@@ -19,9 +19,6 @@
 */
private $stringComparer;
 
-   /**
-* @param StringComparer $stringComparer
-*/
public function __construct( StringComparer $stringComparer ) {
$this->stringComparer = $stringComparer;
}
diff --git a/includes/CrossCheck/Comparer/StringComparer.php 
b/includes/CrossCheck/Comparer/StringComparer.php
index cf8464f..4530a03 100644
--- a/includes/CrossCheck/Comparer/StringComparer.php
+++ b/includes/CrossCheck/Comparer/StringComparer.php
@@ -23,9 +23,6 @@
 */
private $stringNormalizer;
 
-   /**
-* @param StringNormalizer $stringNormalizer
-*/
public function __construct( StringNormalizer $stringNormalizer ) {
$this->stringNormalizer = $stringNormalizer;
}
diff --git a/includes/CrossCheck/Comparer/StringValueComparer.php 
b/includes/CrossCheck/Comparer/StringValueComparer.php
index 90cbf1f..eef62df 100644

[MediaWiki-commits] [Gerrit] mediawiki...PropertySuggester[master]: Improve type hints in different places

2018-01-12 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403951 )

Change subject: Improve type hints in different places
..

Improve type hints in different places

This patch adds missing type hints both in method headers as well as
documentation.

I also remove some comment blocks that repeat 100% exactly what the
method header itself already states.

Change-Id: I44dc9d7fe870a74625bb6498566834a212dcd35b
---
M src/GetSuggestions.php
M src/Hooks.php
M src/ResultBuilder.php
M src/Suggesters/SimpleSuggester.php
M src/UpdateTable/ImportContext.php
5 files changed, 7 insertions(+), 16 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PropertySuggester 
refs/changes/51/403951/1

diff --git a/src/GetSuggestions.php b/src/GetSuggestions.php
index 303ca58..585a980 100644
--- a/src/GetSuggestions.php
+++ b/src/GetSuggestions.php
@@ -148,7 +148,7 @@
 * @param int $resultSize
 * @param string $search
 * @param string $language
-* @return array
+* @return array[]
 */
private function querySearchApi( $resultSize, $search, $language ) {
$searchEntitiesParameters = new DerivativeRequest(
diff --git a/src/Hooks.php b/src/Hooks.php
index 15ac2db..8e02888 100644
--- a/src/Hooks.php
+++ b/src/Hooks.php
@@ -18,8 +18,8 @@
 * Handler for the BeforePageDisplay hook, injects special behaviour
 * for PropertySuggestions in the EntitySuggester (if page is in 
EntityNamespace)
 *
-* @param OutputPage $out
-* @param Skin $skin
+* @param OutputPage &$out
+* @param Skin &$skin
 */
public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
if ( $out->getRequest()->getCheck( 'nosuggestions' ) ) {
@@ -44,9 +44,6 @@
$out->addModules( 'ext.PropertySuggester.EntitySelector' );
}
 
-   /**
-* @param DatabaseUpdater $updater
-*/
public static function onCreateSchema( DatabaseUpdater $updater ) {
$updater->addExtensionTable(
'wbs_propertypairs',
diff --git a/src/ResultBuilder.php b/src/ResultBuilder.php
index 492ee9f..0b30767 100644
--- a/src/ResultBuilder.php
+++ b/src/ResultBuilder.php
@@ -91,7 +91,7 @@
private function buildEntry( EntityId $id, array $clusteredTerms, 
Suggestion $suggestion ) {
$entry = [
'id' => $id->getSerialization(),
-   'url' => $this->entityTitleLookup->getTitleForId( $id 
)->getFullUrl(),
+   'url' => $this->entityTitleLookup->getTitleForId( $id 
)->getFullURL(),
'rating' => $suggestion->getProbability(),
];
 
diff --git a/src/Suggesters/SimpleSuggester.php 
b/src/Suggesters/SimpleSuggester.php
index e786546..e92c10b 100644
--- a/src/Suggesters/SimpleSuggester.php
+++ b/src/Suggesters/SimpleSuggester.php
@@ -41,9 +41,6 @@
 */
private $lb;
 
-   /**
-* @param LoadBalancer $lb
-*/
public function __construct( LoadBalancer $lb ) {
$this->lb = $lb;
}
diff --git a/src/UpdateTable/ImportContext.php 
b/src/UpdateTable/ImportContext.php
index e4235d0..c62209d 100644
--- a/src/UpdateTable/ImportContext.php
+++ b/src/UpdateTable/ImportContext.php
@@ -31,7 +31,7 @@
private $targetTableName = "";
 
/**
-* @var LoadBalancer
+* @var LoadBalancer|null
 */
private $lb = null;
 
@@ -60,16 +60,13 @@
}
 
/**
-* @return LoadBalancer
+* @return LoadBalancer|null
 */
public function getLb() {
return $this->lb;
}
 
-   /**
-* @param LoadBalancer $lb
-*/
-   public function setLb( $lb ) {
+   public function setLb( LoadBalancer $lb ) {
$this->lb = $lb;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44dc9d7fe870a74625bb6498566834a212dcd35b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PropertySuggester
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Rename $wp variables to $wikiPage

2018-01-11 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403669 )

Change subject: Rename $wp variables to $wikiPage
..

Rename $wp variables to $wikiPage

Same as I450cfea was for $sk variables.

Change-Id: I295b4c9d181a65ad8ac2393e764b544754d5a698
---
M includes/api/ApiMobileView.php
M tests/phpunit/api/ApiMobileViewTest.php
2 files changed, 29 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/69/403669/1

diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index 51448b9..e0720d3 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -333,8 +333,8 @@
 */
protected function isMainPage( $title ) {
if ( $title->isRedirect() && $this->followRedirects ) {
-   $wp = $this->makeWikiPage( $title );
-   $target = $wp->getRedirectTarget();
+   $wikiPage = $this->makeWikiPage( $title );
+   $target = $wikiPage->getRedirectTarget();
if ( $target ) {
return $target->isMainPage();
}
@@ -444,14 +444,18 @@
 
/**
 * Performs a page parse
-* @param WikiPage $wp Wiki page object
+* @param WikiPage $wikiPage Wiki page object
 * @param ParserOptions $parserOptions Options for parser
 * @param null|int $oldid Revision ID to get the text from, passing 
null or 0 will
 *   get the current revision (default value)
 * @return ParserOutput|null
 */
-   protected function getParserOutput( WikiPage $wp, ParserOptions 
$parserOptions, $oldid = null ) {
-   $parserOutput = $wp->getParserOutput( $parserOptions, $oldid );
+   protected function getParserOutput(
+   WikiPage $wikiPage,
+   ParserOptions $parserOptions,
+   $oldid = null
+   ) {
+   $parserOutput = $wikiPage->getParserOutput( $parserOptions, 
$oldid );
if ( $parserOutput && !defined( 
'ParserOutput::SUPPORTS_STATELESS_TRANSFORMS' ) ) {
$parserOutput->setTOCEnabled( false );
}
@@ -544,9 +548,9 @@
$mfSpecialCaseMainPage = $mfConfig->get( 
'MFSpecialCaseMainPage' );
 
$result = $this->getResult();
-   $wp = $this->makeWikiPage( $title );
-   if ( $this->followRedirects && $wp->isRedirect() ) {
-   $newTitle = $wp->getRedirectTarget();
+   $wikiPage = $this->makeWikiPage( $title );
+   if ( $this->followRedirects && $wikiPage->isRedirect() ) {
+   $newTitle = $wikiPage->getRedirectTarget();
if ( $newTitle ) {
$title = $newTitle;
$textTitle = $title->getPrefixedText();
@@ -562,12 +566,12 @@
);
return [];
}
-   $wp = $this->makeWikiPage( $title );
+   $wikiPage = $this->makeWikiPage( $title );
}
}
-   $latest = $wp->getLatest();
+   $latest = $wikiPage->getLatest();
// Use page_touched so template updates invalidate cache
-   $touched = $wp->getTouched();
+   $touched = $wikiPage->getTouched();
$revId = $oldid ? $oldid : $title->getLatestRevID();
if ( $this->file ) {
$key = $wgMemc->makeKey(
@@ -587,9 +591,9 @@
// Title::exists() above doesn't seem to always 
catch recently deleted pages
$this->dieWithError( [ 'apierror-missingtitle' 
] );
}
-   $parserOptions = $this->makeParserOptions( $wp );
-   $parserCacheKey = 
\MediaWiki\MediaWikiServices::getInstance()->getParserCache()->getKey( $wp,
-   $parserOptions );
+   $parserOptions = $this->makeParserOptions( $wikiPage );
+   $parserCache = 
\MediaWiki\MediaWikiServices::getInstance()->getParserCache();
+   $parserCacheKey = $parserCache->getKey( $wikiPage, 
$parserOptions );
$key = $wgMemc->makeKey(
'mf',
'mobileview',
@@ -610,7 +614,7 @@
if ( $this->file ) {
$html = $this->getFilePage( $title );
} else {
-   $parserOutput = $this->getParserOutput( $wp, 
$parserOptions, $oldid );
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Update UserSaveOptions/UserSaveSettings hook descriptions

2018-01-11 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403662 )

Change subject: Update UserSaveOptions/UserSaveSettings hook descriptions
..

Update UserSaveOptions/UserSaveSettings hook descriptions

I already updated
https://www.mediawiki.org/wiki/Manual:Hooks/UserSaveOptions
https://www.mediawiki.org/wiki/Manual:Hooks/UserSaveSettings
accordingly.

Change-Id: I492f83aa8acb6521f3e175fdbf507a7e44491ca2
---
M docs/hooks.txt
1 file changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/403662/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index 2c6fc02..5b4de7f 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3803,12 +3803,16 @@
 $add: Array of strings corresponding to groups added
 $remove: Array of strings corresponding to groups removed
 
-'UserSaveOptions': Called just before saving user preferences/options.
-$user: User object
-&$options: Options, modifiable
+'UserSaveOptions': Called just before saving user preferences. Hook handlers 
can either add or
+manipulate options, or reset one back to it's default to block changing it. 
Hook handlers are also
+allowed to abort the process by returning false, e.g. to save to a global 
profile instead. Compare
+to the UserSaveSettings hook, which is called after the preferences have been 
saved.
+$user: The User for which the options are going to be saved
+&$options: The users options as an associative array, modifiable
 
-'UserSaveSettings': Called when saving user settings.
-$user: User object
+'UserSaveSettings': Called directly after user preferences (user_properties in 
the database) have
+been saved. Compare to the UserSaveOptions hook, which is called before.
+$user: The User for which the options have been saved
 
 'UserSetCookies': DEPRECATED! If you're trying to replace core session cookie
 handling, you want to create a subclass of 
MediaWiki\Session\CookieSessionProvider

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I492f83aa8acb6521f3e175fdbf507a7e44491ca2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Move code displaying EntityId on diff pages

2018-01-10 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403448 )

Change subject: Move code displaying EntityId on diff pages
..

Move code displaying EntityId on diff pages

Reasoning:
* The overridePageMetaTags got quite clunky. It was hard to understand
what it does.
* setDiffPageTitle does have access to $outputPage anyway.
* This way I can get rid of one of the if-else structures entirely.
They both really encoded the same knowledge.

Bug: T181077
Change-Id: I29c18c8ad9dbd73cd89cf21d0908e7d042e5244d
---
M repo/includes/Actions/ViewEntityAction.php
1 file changed, 10 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/48/403448/1

diff --git a/repo/includes/Actions/ViewEntityAction.php 
b/repo/includes/Actions/ViewEntityAction.php
index b13a12c..fd7d62f 100644
--- a/repo/includes/Actions/ViewEntityAction.php
+++ b/repo/includes/Actions/ViewEntityAction.php
@@ -92,19 +92,7 @@
 
if ( $this->isDiff() ) {
if ( isset( $meta['title'] ) ) {
-   $configVars = $outputPage->getJsConfigVars();
-   if ( !isset( $configVars['wbEntityId'] ) ) {
-   wfLogWarning( "'wbEntityId' has not 
been found." );
-   $entityId = null;
-   } else {
-   $entityId = $configVars['wbEntityId'];
-   }
-
-   $this->setDiffPageTitle(
-   $outputPage,
-   $meta['title'],
-   $entityId
-   );
+   $this->setDiffPageTitle( $outputPage, 
$meta['title'] );
}
 
// No description, social media tags, or any search 
engine optimization for diffs
@@ -129,21 +117,19 @@
/**
 * @param OutputPage $outputPage
 * @param string $titleText
-* @param string $entityIdSerialization
 */
-   private function setDiffPageTitle(
-   OutputPage $outputPage,
-   $titleText,
-   $entityIdSerialization
-   ) {
-   if ( $entityIdSerialization !== null ) {
-   $id = ' ' .  Html::element(
+   private function setDiffPageTitle( OutputPage $outputPage, $titleText ) 
{
+   $variables = $outputPage->getJsConfigVars();
+
+   if ( !isset( $variables['wbEntityId'] ) ) {
+   wfLogWarning( "'wbEntityId' has not been found." );
+   $id = '';
+   } else {
+   $id = ' ' . Html::element(
'span',
[ 'class' => 'wikibase-title-id' ],
-   $this->msg( 'parentheses' )->plaintextParams( 
$entityIdSerialization )
+   $this->msg( 'parentheses' )->plaintextParams( 
$variables['wbEntityId'] )
);
-   } else {
-   $id = '';
}
 
// Escaping HTML characters in order to retain original label 
that may contain HTML

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29c18c8ad9dbd73cd89cf21d0908e7d042e5244d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Add some missing JSDoc comments

2018-01-10 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403438 )

Change subject: Add some missing JSDoc comments
..

Add some missing JSDoc comments

The additional @class comments help IDEs finding the methods that
belong to a class.

Change-Id: I55c3cb07a760bcc24b0db523dbc4ed38c1c6c5b5
---
M resources/entityChangers/FormChanger.js
M resources/serialization/LexemeDeserializer.js
2 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/38/403438/1

diff --git a/resources/entityChangers/FormChanger.js 
b/resources/entityChangers/FormChanger.js
index c84a3dc..fe75d0d 100644
--- a/resources/entityChangers/FormChanger.js
+++ b/resources/entityChangers/FormChanger.js
@@ -21,7 +21,11 @@
this.lexemeId = lexemeId;
};
 
+   /**
+* @class wikibase.lexeme.entityChangers.FormChanger
+*/
$.extend( SELF.prototype, {
+
/**
 * @type {mediaWiki.Api}
 * @private
diff --git a/resources/serialization/LexemeDeserializer.js 
b/resources/serialization/LexemeDeserializer.js
index 5ef16cf..143abfa 100644
--- a/resources/serialization/LexemeDeserializer.js
+++ b/resources/serialization/LexemeDeserializer.js
@@ -9,7 +9,6 @@
 * @class wikibase.serialization.LexemeDeserializer
 * @extends wikibase.serialization.Deserializer
 * @license GNU GPL v2+
-* @author Adrian Heine 
 *
 * @constructor
 */
@@ -52,6 +51,10 @@
return lexeme;
},
 
+   /**
+* @param {Object} formSerialization
+* @return {wikibase.lexeme.datamodel.Form}
+*/
deserializeForm: function ( formSerialization ) {
var statementGroupSetDeserializer = new 
SERIALIZER.StatementGroupSetDeserializer();
var termMapDeserializer = new 
SERIALIZER.TermMapDeserializer();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55c3cb07a760bcc24b0db523dbc4ed38c1c6c5b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Use "self" for self-references in PHPDoc documentation

2018-01-10 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403437 )

Change subject: Use "self" for self-references in PHPDoc documentation
..

Use "self" for self-references in PHPDoc documentation

Change-Id: I8abd692208c44e1cce041a7086d6f9a8da825946
---
M src/Api/AddFormRequestParserResult.php
M tests/phpunit/composer/ErisGenerators/CartesianProduct.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/37/403437/1

diff --git a/src/Api/AddFormRequestParserResult.php 
b/src/Api/AddFormRequestParserResult.php
index 69d5936..8dc9ff9 100644
--- a/src/Api/AddFormRequestParserResult.php
+++ b/src/Api/AddFormRequestParserResult.php
@@ -26,7 +26,7 @@
 
/**
 * @param ApiError[] $errors
-* @return AddFormRequestParserResult
+* @return self
 */
public static function newWithErrors( array $errors ) {
return new self( null, $errors );
diff --git a/tests/phpunit/composer/ErisGenerators/CartesianProduct.php 
b/tests/phpunit/composer/ErisGenerators/CartesianProduct.php
index 4530cca..b2befb6 100644
--- a/tests/phpunit/composer/ErisGenerators/CartesianProduct.php
+++ b/tests/phpunit/composer/ErisGenerators/CartesianProduct.php
@@ -19,7 +19,7 @@
 * @param GeneratedValueOptions|GeneratedValueSingle $generatedValue
 * @param GeneratedValueOptions|GeneratedValueSingle $_generatedValue
 *
-* @return CartesianProduct
+* @return self
 */
public static function create( $generatedValue /*, 
...$_generatedValue*/ ) {
$args = func_get_args();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8abd692208c44e1cce041a7086d6f9a8da825946
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Rename $sk variables to $skin

2018-01-10 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403435 )

Change subject: Rename $sk variables to $skin
..

Rename $sk variables to $skin

This makes the code a bit easier to read and to understand, for (in my
opinion) two reasons:
* The abbreviation "sk" is not that self-explaining, compared to others.
* The full word "skin" is not that long that it needs to be abbreviated.

This is split from I6a91724 to make it more focussed and easier to
review.

Change-Id: I450cfea8233d137b11ff4b66d1a3486ec238e48b
---
M includes/MobileFrontend.hooks.php
M includes/MobileFrontend.skin.hooks.php
M tests/phpunit/MobileFrontend.hooksTest.php
3 files changed, 28 insertions(+), 28 deletions(-)


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

diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 266ed57..9c91909 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -167,12 +167,12 @@
 *
 * Adds an inline script for lazy loading the images in Grade C 
browsers.
 *
-* @param Skin $sk
+* @param Skin $skin
 * @param string &$html bottomScripts text. Append to $text to add 
additional
 *  text/scripts after the stock bottom scripts.
 * @return bool
 */
-   public static function onSkinAfterBottomScripts( $sk, &$html ) {
+   public static function onSkinAfterBottomScripts( $skin, &$html ) {
$context = MobileContext::singleton();
 
// TODO: We may want to enable the following script on Desktop 
Minerva...
@@ -667,10 +667,10 @@
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay
 *
 * @param OutputPage &$out The OutputPage object.
-* @param Skin &$sk Skin object that will be used to generate the page, 
added in 1.13.
+* @param Skin &$skin Skin object that will be used to generate the 
page, added in 1.13.
 * @return bool
 */
-   public static function onBeforePageDisplay( &$out, &$sk ) {
+   public static function onBeforePageDisplay( &$out, &$skin ) {
$context = MobileContext::singleton();
$config = $context->getMFConfig();
$mfEnableXAnalyticsLogging = $config->get( 
'MFEnableXAnalyticsLogging' );
@@ -680,7 +680,7 @@
$mfMobileUrlTemplate = $context->getMobileUrlTemplate();
$lessVars = $config->get( 'ResourceLoaderLESSVars' );
 
-   $title = $sk->getTitle();
+   $title = $skin->getTitle();
$request = $context->getRequest();
 
// Add deep link to a mobile app specified by $wgMFAppScheme
@@ -777,7 +777,7 @@
$out->addModules( [ 'mobile.site', 'mobile.init' ] );
 
// Allow modifications in mobile only mode
-   Hooks::run( 'BeforePageDisplayMobile', [ &$out, &$sk ] 
);
+   Hooks::run( 'BeforePageDisplayMobile', [ &$out, &$skin 
] );
 
// Warning box styles are needed when reviewing old 
revisions
// and inside the fallback editor styles to action=edit 
page
diff --git a/includes/MobileFrontend.skin.hooks.php 
b/includes/MobileFrontend.skin.hooks.php
index 2a24129..65b2453 100644
--- a/includes/MobileFrontend.skin.hooks.php
+++ b/includes/MobileFrontend.skin.hooks.php
@@ -67,12 +67,12 @@
 * Returns HTML of terms of use link or null if it shouldn't be 
displayed
 * Note: This is called by a hook in the WikimediaMessages extension.
 *
-* @param Skin $sk
+* @param Skin $skin
 * @param string $urlMsgKey Key of i18n message containing terms of use 
URL (optional)
 * @return null|string
 */
-   public static function getTermsLink( $sk, $urlMsgKey = 
'mobile-frontend-terms-url' ) {
-   $urlMsg = $sk->msg( $urlMsgKey )->inContentLanguage();
+   public static function getTermsLink( $skin, $urlMsgKey = 
'mobile-frontend-terms-url' ) {
+   $urlMsg = $skin->msg( $urlMsgKey )->inContentLanguage();
if ( $urlMsg->isDisabled() ) {
return null;
}
@@ -81,7 +81,7 @@
return Html::element(
'a',
[ 'href' => Skin::makeInternalOrExternalUrl( $url ) ],
-   $sk->msg( 'mobile-frontend-terms-text' )->text()
+   $skin->msg( 'mobile-frontend-terms-text' )->text()
);
}
 
@@ -197,13 +197,13 @@
 
/**
 * Appends a mobile view link to the desktop footer
-* @param Skin $sk
+* @param Skin $skin
 * @param QuickTemplate $tpl
 * @param 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: [DNM] Full report for suppressed Phan issues

2018-01-10 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403431 )

Change subject: [DNM] Full report for suppressed Phan issues
..

[DNM] Full report for suppressed Phan issues

Change-Id: I88545447fda855be7fe4093a9a47a2ea682285bb
---
M tests/phan/config.php
1 file changed, 0 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/31/403431/1

diff --git a/tests/phan/config.php b/tests/phan/config.php
index 489b840..d3e1c95 100644
--- a/tests/phan/config.php
+++ b/tests/phan/config.php
@@ -323,42 +323,6 @@
 * to this black-list to inhibit them from being reported.
 */
'suppress_issue_types' => [
-   // approximate error count: 6
-   "PhanDeprecatedClass",
-   // approximate error count: 107
-   "PhanDeprecatedFunction",
-   // approximate error count: 3
-   "PhanParamReqAfterOpt",
-   // approximate error count: 15
-   "PhanParamSignatureMismatch",
-   // approximate error count: 1
-   "PhanParamSignatureMismatchInternal",
-   // approximate error count: 6
-   "PhanParamTooMany",
-   // approximate error count: 2
-   "PhanTypeComparisonToArray",
-   // approximate error count: 50
-   "PhanTypeMismatchArgument",
-   // approximate error count: 8
-   "PhanTypeMismatchArgumentInternal",
-   // approximate error count: 4
-   "PhanTypeMismatchProperty",
-   // approximate error count: 12
-   "PhanTypeMismatchReturn",
-   // approximate error count: 1
-   "PhanTypeMissingReturn",
-   // approximate error count: 1
-   "PhanUndeclaredClassMethod",
-   // approximate error count: 72
-   "PhanUndeclaredConstant",
-   // approximate error count: 171
-   "PhanUndeclaredMethod",
-   // approximate error count: 23
-   "PhanUndeclaredProperty",
-   // approximate error count: 1
-   "PhanUndeclaredTypeParameter",
-   // approximate error count: 4
-   "PhanUndeclaredVariable",
],
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88545447fda855be7fe4093a9a47a2ea682285bb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...TwoColConflict[master]: [DNM] Full report for suppressed Phan issues

2018-01-10 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403428 )

Change subject: [DNM] Full report for suppressed Phan issues
..

[DNM] Full report for suppressed Phan issues

Change-Id: I1db425d7ee78e431251371c2ade2a8370197ce86
---
M tests/phan/config.php
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwoColConflict 
refs/changes/28/403428/1

diff --git a/tests/phan/config.php b/tests/phan/config.php
index 79d33ef..475f123 100644
--- a/tests/phan/config.php
+++ b/tests/phan/config.php
@@ -276,10 +276,6 @@
 * to this black-list to inhibit them from being reported.
 */
'suppress_issue_types' => [
-   // approximate error count: 1
-   "PhanParamSignatureMismatch",
-   // approximate error count: 12
-   "PhanParamTooMany",
],
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1db425d7ee78e431251371c2ade2a8370197ce86
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TwoColConflict
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove some more superfluous documentation snippets

2018-01-10 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403408 )

Change subject: Remove some more superfluous documentation snippets
..

Remove some more superfluous documentation snippets

This patch mostly removes redundant stuff from lines like

@param ClassName $variableName ClassName object

where the later "ClassName object" does not add anything to what's
already entirely obvious from the ClassName and the $variableName
before.

Such documentation is worse than having no documentation, because one
must read it first to understand that it does not explain anything.

This patch makes room for future improvements.

Change-Id: I6a9172498a18a195a530664388bbbd4ac815317a
---
M includes/MobileFormatter.php
M includes/MobileFrontend.hooks.php
M includes/api/ApiMobileView.php
M includes/api/ApiParseExtender.php
M includes/devices/DeviceDetectorService.php
M includes/devices/DeviceProperties.php
M includes/diff/InlineDifferenceEngine.php
M includes/modules/MFResourceLoaderParsedMessageModule.php
M includes/modules/MobileSiteModule.php
M includes/specials/SpecialMobileDiff.php
M includes/specials/SpecialMobileWatchlist.php
M tests/phpunit/api/ApiMobileViewTest.php
12 files changed, 24 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/08/403408/1

diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index a4ada4d..55429ba 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -94,7 +94,7 @@
 *
 * @param MobileContext $context in which the page is being rendered. 
Needed to access page title
 *  and MobileFrontend configuration.
-* @param IContentProvider $provider ContentProvider interface
+* @param IContentProvider $provider
 * @param bool $enableSections (optional)
 *  whether to wrap the content of sections
 * @param bool $includeTOC (optional) whether to include the
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 266ed57..fbf7b45 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -1022,7 +1022,7 @@
 * that no additional assets are requested by the ResourceLoader, i.e. 
they are stub
 * modules.
 *
-* @param ResourceLoader $resourceLoader The ResourceLoader object
+* @param ResourceLoader $resourceLoader
 */
private static function registerMobileLoggingSchemasModule( 
$resourceLoader ) {
$mfResourceFileModuleBoilerplate = [
@@ -1128,7 +1128,7 @@
 * See 
https://www.mediawiki.org/wiki/Manual:Hooks/ThumbnailBeforeProduceHTML
 * for more detail about the `ThumbnailBeforeProduceHTML` hook.
 *
-* @param ThumbnailImage $thumbnail The thumbnail
+* @param ThumbnailImage $thumbnail
 * @param array &$attribs The attributes of the DOMElement being 
contructed
 *  to represent the thumbnail
 * @param array &$linkAttribs The attributes of the DOMElement being
diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index 51448b9..9f92a0e 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -444,14 +444,14 @@
 
/**
 * Performs a page parse
-* @param WikiPage $wp Wiki page object
-* @param ParserOptions $parserOptions Options for parser
+* @param WikiPage $wikiPage
+* @param ParserOptions $parserOptions
 * @param null|int $oldid Revision ID to get the text from, passing 
null or 0 will
 *   get the current revision (default value)
 * @return ParserOutput|null
 */
-   protected function getParserOutput( WikiPage $wp, ParserOptions 
$parserOptions, $oldid = null ) {
-   $parserOutput = $wp->getParserOutput( $parserOptions, $oldid );
+   protected function getParserOutput( WikiPage $wikiPage, ParserOptions 
$parserOptions, $oldid = null ) {
+   $parserOutput = $wikiPage->getParserOutput( $parserOptions, 
$oldid );
if ( $parserOutput && !defined( 
'ParserOutput::SUPPORTS_STATELESS_TRANSFORMS' ) ) {
$parserOutput->setTOCEnabled( false );
}
@@ -486,7 +486,7 @@
 * Parses section data
 * @param string $html representing the entire page
 * @param Title $title Page title
-* @param ParserOutput $parserOutput Options for parser
+* @param ParserOutput $parserOutput
 * @param int $revId this is a temporary parameter to avoid debug log 
warnings.
 *  Long term the call to wfDebugLog should be moved outside this 
method (optional)
 * @return array structure representing the list of sections and their 
properties:
diff --git a/includes/api/ApiParseExtender.php 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove unused code from LegacyHookPreAuthenticationProvider

2018-01-10 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403399 )

Change subject: Remove unused code from LegacyHookPreAuthenticationProvider
..

Remove unused code from LegacyHookPreAuthenticationProvider

The change to the other file is related in so far that these type hints
are crucial, otherwise my PHPStorm can't find all usages of the class
in question.

Change-Id: I699947fe02f649e24c957eb9790fcff91cb2c14a
---
M includes/auth/LegacyHookPreAuthenticationProvider.php
M tests/phpunit/includes/session/SessionManagerTest.php
2 files changed, 18 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/403399/1

diff --git a/includes/auth/LegacyHookPreAuthenticationProvider.php 
b/includes/auth/LegacyHookPreAuthenticationProvider.php
index cab6e32..32caf33 100644
--- a/includes/auth/LegacyHookPreAuthenticationProvider.php
+++ b/includes/auth/LegacyHookPreAuthenticationProvider.php
@@ -58,14 +58,14 @@
$msg = null;
if ( !\Hooks::run( 'LoginUserMigrated', [ $user, &$msg ] ) ) {
return $this->makeFailResponse(
-   $user, null, LoginForm::USER_MIGRATED, $msg, 
'LoginUserMigrated'
+   $user, LoginForm::USER_MIGRATED, $msg, 
'LoginUserMigrated'
);
}
 
$abort = LoginForm::ABORTED;
$msg = null;
if ( !\Hooks::run( 'AbortLogin', [ $user, $password, &$abort, 
&$msg ] ) ) {
-   return $this->makeFailResponse( $user, null, $abort, 
$msg, 'AbortLogin' );
+   return $this->makeFailResponse( $user, $abort, $msg, 
'AbortLogin' );
}
 
return StatusValue::newGood();
@@ -103,7 +103,7 @@
// Hook point to add extra creation throttles 
and blocks
$this->logger->debug( __METHOD__ . ": a hook 
blocked auto-creation: $abortError\n" );
return $this->makeFailResponse(
-   $user, $user, LoginForm::ABORTED, 
$abortError, 'AbortAutoAccount'
+   $user, LoginForm::ABORTED, $abortError, 
'AbortAutoAccount'
);
}
}
@@ -114,13 +114,12 @@
/**
 * Construct an appropriate failure response
 * @param User $user
-* @param User|null $creator
 * @param int $constant LoginForm constant
 * @param string|null $msg Message
 * @param string $hook Hook
 * @return StatusValue
 */
-   protected function makeFailResponse( $user, $creator, $constant, $msg, 
$hook ) {
+   private function makeFailResponse( $user, $constant, $msg, $hook ) {
switch ( $constant ) {
case LoginForm::SUCCESS:
// WTF?
@@ -171,11 +170,8 @@
$error = $msg ?: 'login-migrated-generic';
return call_user_func_array( 
'StatusValue::newFatal', (array)$error );
 
-   // @codeCoverageIgnoreStart
-   case LoginForm::CREATE_BLOCKED: // Can never happen
default:
throw new \DomainException( __METHOD__ . ": 
Unhandled case value from $hook" );
}
-   // @codeCoverageIgnoreEnd
}
 }
diff --git a/tests/phpunit/includes/session/SessionManagerTest.php 
b/tests/phpunit/includes/session/SessionManagerTest.php
index 9eb46bc..c3ee231 100644
--- a/tests/phpunit/includes/session/SessionManagerTest.php
+++ b/tests/phpunit/includes/session/SessionManagerTest.php
@@ -14,7 +14,20 @@
  */
 class SessionManagerTest extends MediaWikiTestCase {
 
-   protected $config, $logger, $store;
+   /**
+* @var \HashConfig
+*/
+   private $config;
+
+   /**
+* @var \TestLogger
+*/
+   private $logger;
+
+   /**
+* @var TestBagOStuff
+*/
+   private $store;
 
protected function getManager() {
\ObjectCache::$instances['testSessionStore'] = new 
TestBagOStuff();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I699947fe02f649e24c957eb9790fcff91cb2c14a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove unused method parameters from TestBagOStuff

2018-01-10 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403397 )

Change subject: Remove unused method parameters from TestBagOStuff
..

Remove unused method parameters from TestBagOStuff

This is a test mock exclusively used in tests. All code I'm removing here
is unused and neither needed nor covered by any test.

Change-Id: Ifd010c49973460f6fbb2cd83f8fd63488f5fd291
---
M tests/phpunit/includes/session/TestBagOStuff.php
1 file changed, 11 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/403397/1

diff --git a/tests/phpunit/includes/session/TestBagOStuff.php 
b/tests/phpunit/includes/session/TestBagOStuff.php
index fd02a2e..f9e30f0 100644
--- a/tests/phpunit/includes/session/TestBagOStuff.php
+++ b/tests/phpunit/includes/session/TestBagOStuff.php
@@ -14,53 +14,44 @@
/**
 * @param string $id Session ID
 * @param array $data Session data
-* @param int $expiry Expiry
-* @param User $user User for metadata
 */
-   public function setSessionData( $id, array $data, $expiry = 0, User 
$user = null ) {
-   $this->setSession( $id, [ 'data' => $data ], $expiry, $user );
+   public function setSessionData( $id, array $data ) {
+   $this->setSession( $id, [ 'data' => $data ] );
}
 
/**
 * @param string $id Session ID
 * @param array $metadata Session metadata
-* @param int $expiry Expiry
 */
-   public function setSessionMeta( $id, array $metadata, $expiry = 0 ) {
-   $this->setSession( $id, [ 'metadata' => $metadata ], $expiry );
+   public function setSessionMeta( $id, array $metadata ) {
+   $this->setSession( $id, [ 'metadata' => $metadata ] );
}
 
/**
 * @param string $id Session ID
 * @param array $blob Session metadata and data
-* @param int $expiry Expiry
-* @param User $user User for metadata
 */
-   public function setSession( $id, array $blob, $expiry = 0, User $user = 
null ) {
+   public function setSession( $id, array $blob ) {
$blob += [
'data' => [],
'metadata' => [],
];
$blob['metadata'] += [
-   'userId' => $user ? $user->getId() : 0,
-   'userName' => $user ? $user->getName() : null,
-   'userToken' => $user ? $user->getToken( true ) : null,
+   'userId' => 0,
+   'userName' => null,
+   'userToken' => null,
'provider' => 'DummySessionProvider',
];
 
-   $this->setRawSession( $id, $blob, $expiry, $user );
+   $this->setRawSession( $id, $blob );
}
 
/**
 * @param string $id Session ID
 * @param array|mixed $blob Session metadata and data
-* @param int $expiry Expiry
 */
-   public function setRawSession( $id, $blob, $expiry = 0 ) {
-   if ( $expiry <= 0 ) {
-   $expiry = \RequestContext::getMain()->getConfig()->get( 
'ObjectCacheSessionExpiry' );
-   }
-
+   public function setRawSession( $id, $blob ) {
+   $expiry = \RequestContext::getMain()->getConfig()->get( 
'ObjectCacheSessionExpiry' );
$this->set( $this->makeKey( 'MWSession', $id ), $blob, $expiry 
);
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd010c49973460f6fbb2cd83f8fd63488f5fd291
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Streamline mw.wikibase.entity:getAllStatements

2018-01-09 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403177 )

Change subject: Streamline mw.wikibase.entity:getAllStatements
..

Streamline mw.wikibase.entity:getAllStatements

This patch fixes one issue: resolving a label might fail and return nil.
An array access with nil does work just fine, but it's still cleaner and
more obvious if this case is checked before.

This patch also streamlines the code and tries to make it as easy to
follow as possible.

Bug: T166056
Change-Id: Ieed8cedadec4bde0f9a35bac8ebf035ad90c72d0
---
M client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua
M client/includes/DataAccess/Scribunto/mw.wikibase.lua
2 files changed, 17 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/77/403177/1

diff --git a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua 
b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua
index f3ebea3..5480425 100644
--- a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua
+++ b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua
@@ -194,31 +194,32 @@
return sitelink.title
 end
 
--- Get claims by property id or label from entity
---
 -- @param {table} entity
 -- @param {string} propertyLabelOrId
-local resolvePropertyClaims = function( entity, propertyLabelOrId )
-   local propertyId
-   if isValidPropertyId( propertyLabelOrId ) then
-   propertyId = propertyLabelOrId
-   else
-   propertyId = mw.wikibase.resolvePropertyId( propertyLabelOrId )
-   end
+local getEntityStatements = function( entity, propertyLabelOrId, funcName )
+   checkType( funcName, 1, propertyLabelOrId, 'string' )
 
-   if entity.claims == nil or not entity.claims[propertyId] then
+   if not entity.claims then
return {}
end
-   return entity.claims[propertyId]
+
+   local propertyId = propertyLabelOrId
+   if not isValidPropertyId( propertyId ) then
+   propertyId = mw.wikibase.resolvePropertyId( propertyId )
+   end
+
+   if propertyId and entity.claims[propertyId] then
+   return entity.claims[propertyId]
+   end
+
+   return {}
 end
 
 -- Get the best statements with the given property id or label
 --
 -- @param {string} propertyLabelOrId
 methodtable.getBestStatements = function( entity, propertyLabelOrId )
-   checkType( 'getBestStatements', 1, propertyLabelOrId, 'string' )
-
-   local entityStatements = resolvePropertyClaims( entity, 
propertyLabelOrId )
+   local entityStatements = getEntityStatements( entity, 
propertyLabelOrId, 'getBestStatements' )
local statements = {}
local bestRank = 'normal'
 
@@ -238,9 +239,7 @@
 --
 -- @param {string} propertyLabelOrId
 methodtable.getAllStatements = function( entity, propertyLabelOrId )
-   checkType( 'getAllStatements', 1, propertyLabelOrId, 'string' )
-
-   return resolvePropertyClaims( entity, propertyLabelOrId )
+   return getEntityStatements( entity, propertyLabelOrId, 
'getAllStatements' )
 end
 
 -- Get a table with all property ids attached to the entity.
diff --git a/client/includes/DataAccess/Scribunto/mw.wikibase.lua 
b/client/includes/DataAccess/Scribunto/mw.wikibase.lua
index 2199bc9..4066a55 100644
--- a/client/includes/DataAccess/Scribunto/mw.wikibase.lua
+++ b/client/includes/DataAccess/Scribunto/mw.wikibase.lua
@@ -137,6 +137,7 @@
 
-- @param {string} entityId
-- @param {string} propertyId
+   -- @param {string} funcName
-- @param {string} rank Which statements to include. Either "best" or 
"all".
local getEntityStatements = function( entityId, propertyId, funcName, 
rank )
if not php.getSetting( 'allowArbitraryDataAccess' ) and 
entityId ~= wikibase.getEntityIdForCurrentPage() then

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieed8cedadec4bde0f9a35bac8ebf035ad90c72d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix type hint in ApiErrorFormatter::addMessagesFromStatus

2018-01-09 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403145 )

Change subject: Fix type hint in ApiErrorFormatter::addMessagesFromStatus
..

Fix type hint in ApiErrorFormatter::addMessagesFromStatus

Change-Id: Ia7b628e9f6a7f8c8d803732504621c13976bf618
---
M includes/api/ApiErrorFormatter.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/45/403145/1

diff --git a/includes/api/ApiErrorFormatter.php 
b/includes/api/ApiErrorFormatter.php
index 1749ce7..c637752 100644
--- a/includes/api/ApiErrorFormatter.php
+++ b/includes/api/ApiErrorFormatter.php
@@ -112,7 +112,7 @@
 * Add warnings and errors from a StatusValue object to the result
 * @param string|null $modulePath
 * @param StatusValue $status
-* @param string[] $types 'warning' and/or 'error'
+* @param string[]|string $types 'warning' and/or 'error'
 */
public function addMessagesFromStatus(
$modulePath, StatusValue $status, $types = [ 'warning', 'error' 
]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7b628e9f6a7f8c8d803732504621c13976bf618
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use IDatabase interface instead of Database in DBAccessBase

2018-01-09 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403143 )

Change subject: Use IDatabase interface instead of Database in DBAccessBase
..

Use IDatabase interface instead of Database in DBAccessBase

There is one subclass I'm aware of that overwrites the releaseConnection
method. It's in the EducationProgram extension and already updated, see
Ibb067ca.

Change-Id: I68504f9cd32aa0d0c6c068dbaa1f2ee65649afa4
---
M includes/dao/DBAccessBase.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/43/403143/1

diff --git a/includes/dao/DBAccessBase.php b/includes/dao/DBAccessBase.php
index 0f8d7f7..6e171d5 100644
--- a/includes/dao/DBAccessBase.php
+++ b/includes/dao/DBAccessBase.php
@@ -1,6 +1,6 @@
 wiki );
@@ -71,9 +71,9 @@
 *
 * @since 1.21
 *
-* @param Database $db The database connection to release.
+* @param IDatabase $db The database connection to release.
 */
-   protected function releaseConnection( Database $db ) {
+   protected function releaseConnection( IDatabase $db ) {
if ( $this->wiki !== false ) {
$loadBalancer = $this->getLoadBalancer();
$loadBalancer->reuseConnection( $db );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68504f9cd32aa0d0c6c068dbaa1f2ee65649afa4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Update outdated WikiPageDeletionUpdates documentation

2018-01-09 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403139 )

Change subject: Update outdated WikiPageDeletionUpdates documentation
..

Update outdated WikiPageDeletionUpdates documentation

This was already updated on
https://www.mediawiki.org/wiki/Manual:Hooks/WikiPageDeletionUpdates
more than a year ago, just missed here.

This patch is a direct follow up for a request in I3a42ec1.

Change-Id: I595b78da214c736d8e73d6d8c7af34a1613dd076
---
M docs/hooks.txt
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/403139/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index 45387a3..2c6fc02 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3917,14 +3917,15 @@
 &$opts: Options to use for the query
 &$join: Join conditions
 
-'WikiPageDeletionUpdates': manipulate the list of DataUpdates to be applied 
when
+'WikiPageDeletionUpdates': manipulate the list of DeferrableUpdates to be 
applied when
 a page is deleted. Called in WikiPage::getDeletionUpdates(). Note that updates
 specific to a content model should be provided by the respective Content's
 getDeletionUpdates() method.
 $page: the WikiPage
-$content: the Content to generate updates for (or null, if the Content could 
not be loaded
-due to an error)
-&$updates: the array of DataUpdate objects. Hook function may want to add to 
it.
+$content: the Content to generate updates for, or null in case the page 
revision could not be
+  loaded. The delete will succeed despite this.
+&$updates: the array of objects that implement DeferrableUpdate. Hook function 
may want to add to
+  it.
 
 'WikiPageFactory': Override WikiPage class used for a title
 $title: Title of the page

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I595b78da214c736d8e73d6d8c7af34a1613dd076
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Use self reference instead of repeating the class name

2018-01-09 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403137 )

Change subject: Use self reference instead of repeating the class name
..

Use self reference instead of repeating the class name

Change-Id: I605a4c287d695db3b019495632c1624c2b54c405
---
M src/ConstraintCheck/Cache/CachingMetadata.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/37/403137/1

diff --git a/src/ConstraintCheck/Cache/CachingMetadata.php 
b/src/ConstraintCheck/Cache/CachingMetadata.php
index 328be5a..b1867b1 100644
--- a/src/ConstraintCheck/Cache/CachingMetadata.php
+++ b/src/ConstraintCheck/Cache/CachingMetadata.php
@@ -40,7 +40,7 @@
/**
 * Deserializes the metadata from an array (or null if the value is 
fresh).
 * @param array|null $array As returned by toArray.
-* @return CachingMetadata
+* @return self
 */
public static function ofArray( array $array = null ) {
$ret = new self;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I605a4c287d695db3b019495632c1624c2b54c405
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix incomplete type hint in LineReader

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402860 )

Change subject: Fix incomplete type hint in LineReader
..

Fix incomplete type hint in LineReader

This fixes a Phan issue (the incomplete type hint). Note that I'm also
replacing false with null. The code is unaffected by this, but I find a
nullable property easier to understand than a variable that switches
between two types (bool and ressource) that can potentially be confused.

Change-Id: I80b4e44ec3227b3c46f98385aebbfe83e0eabc52
---
M repo/includes/IO/LineReader.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/60/402860/1

diff --git a/repo/includes/IO/LineReader.php b/repo/includes/IO/LineReader.php
index f64c598..14d1c51 100644
--- a/repo/includes/IO/LineReader.php
+++ b/repo/includes/IO/LineReader.php
@@ -16,7 +16,7 @@
 class LineReader implements Iterator {
 
/**
-* @var resource
+* @var resource|null
 */
private $fileHandle;
 
@@ -80,7 +80,7 @@
fclose( $this->fileHandle );
}
 
-   $this->fileHandle = false;
+   $this->fileHandle = null;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80b4e44ec3227b3c46f98385aebbfe83e0eabc52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Don't use generic ID parser when a PropertyId is required

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402858 )

Change subject: Don't use generic ID parser when a PropertyId is required
..

Don't use generic ID parser when a PropertyId is required

This fixes an issue Phan reports.

The generic parser can return any EntityId. But the very next line in
the same method does have a strict type hint against PropertyId.

What this patch effectively does is replacing a possible runtime
exception (an incompatible EntityId can be passed to a method that
expects a PropertyId) with a more expressive parsing exception (an ID
string does not result in a PropertyId).

This code might need more love, but I believe this small step is
already an improvement.

Change-Id: I0066fe188dc53ac9fd3cae3ab523d52477eeec06
---
M client/includes/DataAccess/Scribunto/WikibaseLuaEntityBindings.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/58/402858/1

diff --git a/client/includes/DataAccess/Scribunto/WikibaseLuaEntityBindings.php 
b/client/includes/DataAccess/Scribunto/WikibaseLuaEntityBindings.php
index 306a3ff..872b29f 100644
--- a/client/includes/DataAccess/Scribunto/WikibaseLuaEntityBindings.php
+++ b/client/includes/DataAccess/Scribunto/WikibaseLuaEntityBindings.php
@@ -6,6 +6,7 @@
 use Wikibase\Client\DataAccess\StatementTransclusionInteractor;
 use Wikibase\Client\Usage\UsageAccumulator;
 use Wikibase\DataModel\Entity\EntityIdParser;
+use Wikibase\DataModel\Entity\PropertyId;
 
 /**
  * Actual implementations of the functions to access Wikibase through the 
Scribunto extension
@@ -117,7 +118,7 @@
 */
public function addStatementUsage( $entityId, $propertyId ) {
$entityId = $this->entityIdParser->parse( $entityId );
-   $propertyId = $this->entityIdParser->parse( $propertyId );
+   $propertyId = new PropertyId( $propertyId );
 
$this->usageAccumulator->addStatementUsage( $entityId, 
$propertyId );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0066fe188dc53ac9fd3cae3ab523d52477eeec06
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Type hint EntityDeserializer as DispatchableDeserializer

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402856 )

Change subject: Type hint EntityDeserializer as DispatchableDeserializer
..

Type hint EntityDeserializer as DispatchableDeserializer

The return value is going to be used in a context that expects this to
be a DispatchableDeserializer.

Reported by Phan.

Change-Id: If471fc3b2a4c10cafc587667ab11b1e12ed33beb
---
M repo/includes/WikibaseRepo.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/56/402856/1

diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index 8c0990d..7291fae 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Repo;
 
+use Deserializers\DispatchableDeserializer;
 use Wikibase\Lib\Changes\CentralIdLookupFactory;
 use Wikibase\Lib\DataTypeFactory;
 use DataValues\DataValueFactory;
@@ -1358,7 +1359,7 @@
/**
 * Returns a deserializer to deserialize entities in current 
serialization only.
 *
-* @return Deserializer
+* @return DispatchableDeserializer
 */
private function getAllTypesEntityDeserializer() {
if ( $this->entityDeserializer === null ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If471fc3b2a4c10cafc587667ab11b1e12ed33beb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add missing import to WikibaseServices

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402855 )

Change subject: Add missing import to WikibaseServices
..

Add missing import to WikibaseServices

Reported by Phan. This mistake triggers a whole series of warnings
that are all fixed by this line.

Change-Id: I07129c482a857d381e5e7452f9422856843540bc
---
M data-access/src/WikibaseServices.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/55/402855/1

diff --git a/data-access/src/WikibaseServices.php 
b/data-access/src/WikibaseServices.php
index c664dfe..af686fd 100644
--- a/data-access/src/WikibaseServices.php
+++ b/data-access/src/WikibaseServices.php
@@ -9,6 +9,7 @@
 use Wikibase\LanguageFallbackChainFactory;
 use Wikibase\Lib\Interactors\TermSearchInteractorFactory;
 use Wikibase\Lib\Store\EntityInfoBuilderFactory;
+use Wikibase\Lib\Store\EntityNamespaceLookup;
 use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Lib\Store\EntityStoreWatcher;
 use Wikibase\Lib\Store\PropertyInfoLookup;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07129c482a857d381e5e7452f9422856843540bc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Replace ArrayIterator with more trivial PageEntityUsages[]

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402854 )

Change subject: Replace ArrayIterator with more trivial PageEntityUsages[]
..

Replace ArrayIterator with more trivial PageEntityUsages[]

I might miss something, but I don't see the point in wrapping this
array in an ArrayIterator. Maybe the functionality of ArrayIterator
was used in the past, but currently it's unused. The only code path
that consumes this array iterates it. That's all.

Change-Id: I8e7750075c5bb1d2efd9b475c36b3e5eca7c3b6e
---
M client/includes/Changes/AffectedPagesFinder.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/54/402854/1

diff --git a/client/includes/Changes/AffectedPagesFinder.php 
b/client/includes/Changes/AffectedPagesFinder.php
index 8c2d502..02e39bd 100644
--- a/client/includes/Changes/AffectedPagesFinder.php
+++ b/client/includes/Changes/AffectedPagesFinder.php
@@ -101,7 +101,7 @@
/**
 * @param Change $change
 *
-* @return ArrayIterator of PageEntityUsage
+* @return PageEntityUsages[]
 */
public function getAffectedUsagesByPage( Change $change ) {
if ( $change instanceof EntityChange ) {
@@ -109,7 +109,7 @@
return $this->filterUpdates( $usages );
}
 
-   return new ArrayIterator();
+   return [];
}
 
/**
@@ -304,7 +304,7 @@
 *
 * @param Traversable $usages A traversable of PageEntityUsages.
 *
-* @return ArrayIterator of PageEntityUsages
+* @return PageEntityUsages[]
 */
private function filterUpdates( Traversable $usages ) {
$titlesToUpdate = [];
@@ -326,7 +326,7 @@
$titlesToUpdate[$key] = $pageEntityUsages;
}
 
-   return new ArrayIterator( $titlesToUpdate );
+   return $titlesToUpdate;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e7750075c5bb1d2efd9b475c36b3e5eca7c3b6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix broken SiteStore type hint in SitesBuilder

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402852 )

Change subject: Fix broken SiteStore type hint in SitesBuilder
..

Fix broken SiteStore type hint in SitesBuilder

Reported by Phan.

Luckily this had no effect in production because the SiteLookup we
have is also a SiteStore.

Change-Id: I3cf63fdeaf5b043d7e1914f7b7b180a2d89d417d
---
M lib/includes/Sites/SitesBuilder.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/52/402852/1

diff --git a/lib/includes/Sites/SitesBuilder.php 
b/lib/includes/Sites/SitesBuilder.php
index 6dd191d..6975b85 100644
--- a/lib/includes/Sites/SitesBuilder.php
+++ b/lib/includes/Sites/SitesBuilder.php
@@ -3,7 +3,7 @@
 namespace Wikibase\Lib\Sites;
 
 use Site;
-use SiteLookup;
+use SiteStore;
 
 /**
  * Builds the site identifiers table
@@ -16,7 +16,7 @@
 class SitesBuilder {
 
/**
-* @var SiteLookup
+* @var SiteStore
 */
private $store;
 
@@ -26,10 +26,10 @@
private $validGroups;
 
/**
-* @param SiteLookup $store
+* @param SiteStore $store
 * @param string[] $validGroups
 */
-   public function __construct( SiteLookup $store, array $validGroups ) {
+   public function __construct( SiteStore $store, array $validGroups ) {
$this->store = $store;
$this->validGroups = $validGroups;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3cf63fdeaf5b043d7e1914f7b7b180a2d89d417d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove unused arguments

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402846 )

Change subject: Remove unused arguments
..

Remove unused arguments

As reported by Phan.

Change-Id: I7637e660e8505fd99721c2dca4d34760f8a08ff3
---
M repo/WikibaseRepo.datatypes.php
M repo/includes/WikibaseRepo.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/46/402846/1

diff --git a/repo/WikibaseRepo.datatypes.php b/repo/WikibaseRepo.datatypes.php
index eff1db7..3bf0e6f 100644
--- a/repo/WikibaseRepo.datatypes.php
+++ b/repo/WikibaseRepo.datatypes.php
@@ -320,7 +320,7 @@

$repo->getStore()->getPropertyInfoLookup(),
PropertyInfoStore::KEY_CANONICAL_URI
);
-   return new ExternalIdentifierRdfBuilder( 
$uriPatternProvider, $vocab );
+   return new ExternalIdentifierRdfBuilder( 
$uriPatternProvider );
},
],
'VT:wikibase-entityid' => [
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index 8c0990d..84fd995 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -1072,7 +1072,7 @@
$formatter = $this->getMessageParameterFormatter();
$localizers = $this->getExceptionLocalizers( $formatter 
);
 
-   $this->exceptionLocalizer = new 
DispatchingExceptionLocalizer( $localizers, $formatter );
+   $this->exceptionLocalizer = new 
DispatchingExceptionLocalizer( $localizers );
}
 
return $this->exceptionLocalizer;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7637e660e8505fd99721c2dca4d34760f8a08ff3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Declare RevisionData::$siteId property

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402850 )

Change subject: Declare RevisionData::$siteId property
..

Declare RevisionData::$siteId property

Reported by Phan.

Change-Id: I94ba40d4400c57c0a128ebb389903ad7cd6478fe
---
M client/includes/RecentChanges/RevisionData.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/50/402850/1

diff --git a/client/includes/RecentChanges/RevisionData.php 
b/client/includes/RecentChanges/RevisionData.php
index 7ab6d63..e7da427 100644
--- a/client/includes/RecentChanges/RevisionData.php
+++ b/client/includes/RecentChanges/RevisionData.php
@@ -34,6 +34,11 @@
protected $commentHtml;
 
/**
+* @var string
+*/
+   private $siteId;
+
+   /**
 * @var array
 */
protected $changeParams;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94ba40d4400c57c0a128ebb389903ad7cd6478fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix bad type hints for ApiErrorReporter

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402849 )

Change subject: Fix bad type hints for ApiErrorReporter
..

Fix bad type hints for ApiErrorReporter

As reported by Phan.

Luckily this mistake did not had any consequence.

Change-Id: Ie133bb642681e56d9105eca536c1f17aaf750004
---
M repo/includes/Api/RemoveQualifiers.php
M repo/includes/Api/SetClaimValue.php
M repo/includes/Api/StatementModificationHelper.php
3 files changed, 7 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/49/402849/1

diff --git a/repo/includes/Api/RemoveQualifiers.php 
b/repo/includes/Api/RemoveQualifiers.php
index 911cce1..bf1d001 100644
--- a/repo/includes/Api/RemoveQualifiers.php
+++ b/repo/includes/Api/RemoveQualifiers.php
@@ -54,7 +54,7 @@
/**
 * @param ApiMain $mainModule
 * @param string $moduleName
-* @param string $errorReporter
+* @param ApiErrorReporter $errorReporter
 * @param StatementChangeOpFactory $statementChangeOpFactory
 * @param StatementModificationHelper $modificationHelper
 * @param StatementGuidParser $guidParser
@@ -64,7 +64,7 @@
public function __construct(
ApiMain $mainModule,
$moduleName,
-   $errorReporter,
+   ApiErrorReporter $errorReporter,
StatementChangeOpFactory $statementChangeOpFactory,
StatementModificationHelper $modificationHelper,
StatementGuidParser $guidParser,
diff --git a/repo/includes/Api/SetClaimValue.php 
b/repo/includes/Api/SetClaimValue.php
index ed76bab..6246dbf 100644
--- a/repo/includes/Api/SetClaimValue.php
+++ b/repo/includes/Api/SetClaimValue.php
@@ -49,7 +49,7 @@
/**
 * @param ApiMain $mainModule
 * @param string $moduleName
-* @param string $errorReporter
+* @param ApiErrorReporter $errorReporter
 * @param StatementChangeOpFactory $statementChangeOpFactory
 * @param StatementModificationHelper $modificationHelper
 * @param StatementGuidParser $guidParser
@@ -59,7 +59,7 @@
public function __construct(
ApiMain $mainModule,
$moduleName,
-   $errorReporter,
+   ApiErrorReporter $errorReporter,
StatementChangeOpFactory $statementChangeOpFactory,
StatementModificationHelper $modificationHelper,
StatementGuidParser $guidParser,
@@ -67,6 +67,7 @@
callable $entitySavingHelperInstantiator
) {
parent::__construct( $mainModule, $moduleName );
+
$this->errorReporter = $errorReporter;
$this->statementChangeOpFactory = $statementChangeOpFactory;
$this->modificationHelper = $modificationHelper;
diff --git a/repo/includes/Api/StatementModificationHelper.php 
b/repo/includes/Api/StatementModificationHelper.php
index 78c729c..992a6b0 100644
--- a/repo/includes/Api/StatementModificationHelper.php
+++ b/repo/includes/Api/StatementModificationHelper.php
@@ -47,12 +47,9 @@
 
/**
 * @var ApiErrorReporter
-*
-* @param SnakFactory $snakFactory
-* @param EntityIdParser $entityIdParser
-* @param StatementGuidValidator $guidValidator
-* @param ApiErrorReporter $errorReporter
 */
+   private $errorReporter;
+
public function __construct(
SnakFactory $snakFactory,
EntityIdParser $entityIdParser,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie133bb642681e56d9105eca536c1f17aaf750004
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix documentation mistakes as reported by Phan

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402845 )

Change subject: Fix documentation mistakes as reported by Phan
..

Fix documentation mistakes as reported by Phan

This patch fixes a whole bunch of issues as reported by Phan. The patch
focuses exclusively on comments, and should be very easy to review because
of this.

Change-Id: I010f05743881b5f107745ea28327063c18db01b6
---
M client/WikibaseClient.hooks.php
M client/includes/Api/ApiListEntityUsage.php
M client/includes/Api/ApiPropsEntityUsage.php
M client/includes/RecentChanges/ExternalChangeFactory.php
M client/includes/Store/Sql/DirectSqlStore.php
M lib/includes/EntityTypeDefinitions.php
M lib/includes/Interactors/TermIndexSearchInteractor.php
M lib/includes/RepositoryDefinitions.php
M repo/includes/Content/PropertyHandler.php
M repo/includes/Dumpers/JsonDumpGenerator.php
M repo/includes/Specials/SpecialAvailableBadges.php
M repo/includes/Specials/SpecialSetLabelDescriptionAliases.php
12 files changed, 40 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/45/402845/1

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index b53ef3c..4886dbd 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -312,6 +312,9 @@
}
}
 
+   /**
+* @param array[] &$queryPages
+*/
public static function onwgQueryPages( &$queryPages ) {
$queryPages[] = [ SpecialUnconnectedPages::class, 
'UnconnectedPages' ];
$queryPages[] = [ SpecialPagesWithBadges::class, 
'PagesWithBadges' ];
diff --git a/client/includes/Api/ApiListEntityUsage.php 
b/client/includes/Api/ApiListEntityUsage.php
index fbc44b4..c80a398 100644
--- a/client/includes/Api/ApiListEntityUsage.php
+++ b/client/includes/Api/ApiListEntityUsage.php
@@ -36,6 +36,11 @@
$this->repoLinker = $repoLinker;
}
 
+   /**
+* @see ApiQueryGeneratorBase::executeGenerator
+*
+* @param ApiPageSet $resultPageSet
+*/
public function executeGenerator( $resultPageSet ) {
$this->run( $resultPageSet );
}
@@ -168,6 +173,13 @@
);
}
 
+   /**
+* @see ApiQueryBase::getCacheMode
+*
+* @param array $params
+*
+* @return string
+*/
public function getCacheMode( $params ) {
return 'public';
}
diff --git a/client/includes/Api/ApiPropsEntityUsage.php 
b/client/includes/Api/ApiPropsEntityUsage.php
index 41d022b..092eab6 100644
--- a/client/includes/Api/ApiPropsEntityUsage.php
+++ b/client/includes/Api/ApiPropsEntityUsage.php
@@ -105,6 +105,13 @@
);
}
 
+   /**
+* @see ApiQueryBase::getCacheMode
+*
+* @param array $params
+*
+* @return string
+*/
public function getCacheMode( $params ) {
return 'public';
}
diff --git a/client/includes/RecentChanges/ExternalChangeFactory.php 
b/client/includes/RecentChanges/ExternalChangeFactory.php
index 6f01fb1..c02fe57 100644
--- a/client/includes/RecentChanges/ExternalChangeFactory.php
+++ b/client/includes/RecentChanges/ExternalChangeFactory.php
@@ -196,7 +196,7 @@
 * @param array|string $comment
 * @param string $type
 *
-* @return string
+* @return array
 */
private function parseAutoComment( $comment, $type ) {
$newComment = [
diff --git a/client/includes/Store/Sql/DirectSqlStore.php 
b/client/includes/Store/Sql/DirectSqlStore.php
index e5d0404..6c0fc7b 100644
--- a/client/includes/Store/Sql/DirectSqlStore.php
+++ b/client/includes/Store/Sql/DirectSqlStore.php
@@ -100,7 +100,7 @@
private $cacheDuration;
 
/**
-* @var EntityLookup|null
+* @var EntityRevisionLookup|null
 */
private $entityRevisionLookup = null;
 
diff --git a/lib/includes/EntityTypeDefinitions.php 
b/lib/includes/EntityTypeDefinitions.php
index a5b1d6c..7c54a21 100644
--- a/lib/includes/EntityTypeDefinitions.php
+++ b/lib/includes/EntityTypeDefinitions.php
@@ -52,7 +52,7 @@
/**
 * @param string $field
 *
-* @return callable[]
+* @return array
 */
private function getMapForDefinitionField( $field ) {
$fieldValues = [];
diff --git a/lib/includes/Interactors/TermIndexSearchInteractor.php 
b/lib/includes/Interactors/TermIndexSearchInteractor.php
index c981d82..9c750a0 100644
--- a/lib/includes/Interactors/TermIndexSearchInteractor.php
+++ b/lib/includes/Interactors/TermIndexSearchInteractor.php
@@ -220,8 +220,7 @@
/**
 * @param TermIndexEntry[] $termIndexEntries
 *
-* @return array[]
-* @see 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Use IResultWrapper instead of ResultWrapper when applicable

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402844 )

Change subject: Use IResultWrapper instead of ResultWrapper when applicable
..

Use IResultWrapper instead of ResultWrapper when applicable

In all these cases the object is exclusively used as an iterator. I could
as well change the type hint to "Traversable" or "stdClass[]". What do
you think?

For the moment I decided to just use the more narrow interface instead of
the implementation.

Change-Id: Ied6fee7f7cfabc0b58da9606166d8d8eabed667a
---
M client/includes/Api/ApiListEntityUsage.php
M client/includes/Api/ApiPropsEntityUsage.php
M client/includes/Store/Sql/BulkSubscriptionUpdater.php
M client/includes/Usage/Sql/EntityUsageTableBuilder.php
M lib/includes/Store/Sql/EntityChangeLookup.php
M lib/includes/Store/Sql/PropertyInfoTable.php
M lib/includes/Store/Sql/SqlEntityInfoBuilder.php
M lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php
M repo/includes/Api/ListSubscribers.php
M repo/includes/Hooks/LabelPrefetchHookHandlers.php
M repo/includes/Store/Sql/ChangesSubscriptionTableBuilder.php
M repo/includes/Store/Sql/SqlEntitiesWithoutTermFinder.php
M repo/includes/Store/Sql/SqlEntityIdPager.php
13 files changed, 45 insertions(+), 45 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/44/402844/1

diff --git a/client/includes/Api/ApiListEntityUsage.php 
b/client/includes/Api/ApiListEntityUsage.php
index fbc44b4..afd16d2 100644
--- a/client/includes/Api/ApiListEntityUsage.php
+++ b/client/includes/Api/ApiListEntityUsage.php
@@ -10,7 +10,7 @@
 use Title;
 use Wikibase\Client\RepoLinker;
 use Wikibase\Client\Usage\EntityUsage;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 
 /**
  * API module to get the usage of entities.
@@ -72,13 +72,13 @@
}
 
/**
-* @param ResultWrapper $res
+* @param IResultWrapper $res
 * @param int $limit
 * @param array $prop
 * @param ApiPageSet|null $resultPageSet
 */
private function formatResult(
-   ResultWrapper $res,
+   IResultWrapper $res,
$limit,
array $prop,
ApiPageSet $resultPageSet = null
@@ -176,7 +176,7 @@
 * @param array $params
 * @param ApiPageSet|null $resultPageSet
 *
-* @return ResultWrapper|null
+* @return IResultWrapper|null
 */
public function doQuery( array $params, ApiPageSet $resultPageSet = 
null ) {
if ( !$params['entities'] ) {
diff --git a/client/includes/Api/ApiPropsEntityUsage.php 
b/client/includes/Api/ApiPropsEntityUsage.php
index 41d022b..1325b2a 100644
--- a/client/includes/Api/ApiPropsEntityUsage.php
+++ b/client/includes/Api/ApiPropsEntityUsage.php
@@ -8,7 +8,7 @@
 use ApiResult;
 use Wikibase\Client\RepoLinker;
 use Wikibase\Client\Usage\EntityUsage;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 
 /**
  * API module to get the usage of entities.
@@ -46,11 +46,11 @@
}
 
/**
-* @param ResultWrapper $res
+* @param IResultWrapper $res
 * @param int $limit
 * @param array $prop
 */
-   private function formatResult( ResultWrapper $res, $limit, array $prop 
) {
+   private function formatResult( IResultWrapper $res, $limit, array $prop 
) {
$currentPageId = null;
$entry = [];
$count = 0;
@@ -112,7 +112,7 @@
/**
 * @param array $params
 *
-* @return ResultWrapper|null
+* @return IResultWrapper|null
 */
public function doQuery( array $params ) {
$pages = $this->getPageSet()->getGoodTitles();
diff --git a/client/includes/Store/Sql/BulkSubscriptionUpdater.php 
b/client/includes/Store/Sql/BulkSubscriptionUpdater.php
index 2c98e65..a6ceda9 100644
--- a/client/includes/Store/Sql/BulkSubscriptionUpdater.php
+++ b/client/includes/Store/Sql/BulkSubscriptionUpdater.php
@@ -9,7 +9,7 @@
 use Wikibase\Lib\Reporting\LogWarningExceptionHandler;
 use Wikibase\Lib\Reporting\MessageReporter;
 use Wikibase\Lib\Reporting\NullMessageReporter;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\SessionConsistentConnectionManager;
 
 /**
@@ -232,14 +232,14 @@
 * Extracts entity id strings from the rows in a query result, and 
updates $continuation
 * to a position "after" the content of the given query result.
 *
-* @param ResultWrapper $res A result set with the field given by 
$entityIdField field set for each row.
+* @param IResultWrapper $res A result set with the field given by 
$entityIdField field set for each row.
 *The result is expected to be sorted by entity id, in 
ascending order.
 * @param 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove default "return true" from Wikibase Client hook handlers

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402839 )

Change subject: Remove default "return true" from Wikibase Client hook handlers
..

Remove default "return true" from Wikibase Client hook handlers

This is the default anyway, and does not make a difference.

Change-Id: I381c6dd9e46333fb999ec108acc21cef0fb6c059
---
M client/WikibaseClient.hooks.php
1 file changed, 2 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/39/402839/1

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index b53ef3c..8f8ae4f 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -52,13 +52,9 @@
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList
 *
 * @param string[] &$paths
-*
-* @return bool
 */
public static function registerUnitTests( array &$paths ) {
$paths[] = __DIR__ . '/tests/phpunit/';
-
-   return true;
}
 
/**
@@ -66,8 +62,6 @@
 *
 * @param string $engine
 * @param array $extraLibraries
-*
-* @return bool
 */
public static function onScribuntoExternalLibraries( $engine, array 
&$extraLibraries ) {
$allowDataTransclusion = 
WikibaseClient::getDefaultInstance()->getSettings()->getSetting( 
'allowDataTransclusion' );
@@ -75,8 +69,6 @@
$extraLibraries['mw.wikibase'] = 
Scribunto_LuaWikibaseLibrary::class;
$extraLibraries['mw.wikibase.entity'] = 
Scribunto_LuaWikibaseEntityLibrary::class;
}
-
-   return true;
}
 
/**
@@ -90,8 +82,6 @@
 * @param Title|null $title use for further information
 * @param bool $local shall links be generated locally or globally
 * @param string|null $wikiId The ID of the wiki the comment applies 
to, if not the local wiki.
-*
-* @return bool
 */
public static function onFormat( &$comment, $pre, $auto, $post, $title, 
$local, $wikiId = null ) {
global $wgContLang;
@@ -122,8 +112,6 @@
 *
 * @param BaseTemplate $baseTemplate
 * @param array $toolbox
-*
-* @return bool
 */
public static function onBaseTemplateToolbox( BaseTemplate 
$baseTemplate, array &$toolbox ) {
$wikibaseClient = WikibaseClient::getDefaultInstance();
@@ -149,8 +137,6 @@
'id' => 't-wikibase'
];
}
-
-   return true;
}
 
/**
@@ -173,8 +159,6 @@
 *
 * @param OutputPage &$out
 * @param Skin &$skin
-*
-* @return bool
 */
public static function onBeforePageDisplayAddJsConfig( OutputPage 
&$out, Skin &$skin ) {
$prefixedId = $out->getProperty( 'wikibase_item' );
@@ -182,8 +166,6 @@
if ( $prefixedId !== null ) {
$out->addJsConfigVars( 'wgWikibaseItemId', $prefixedId 
);
}
-
-   return true;
}
 
/**
@@ -192,8 +174,6 @@
 *
 * @param OutputPage &$out
 * @param Skin &$skin
-*
-* @return bool
 */
public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
$namespaceChecker = 
WikibaseClient::getDefaultInstance()->getNamespaceChecker();
@@ -201,8 +181,6 @@
 
$actionName = Action::getActionName( $skin->getContext() );
$beforePageDisplayHandler->addModules( $out, $actionName );
-
-   return true;
}
 
/**
@@ -210,14 +188,12 @@
 *
 * @param User $user
 * @param array[] &$prefs
-*
-* @return bool
 */
public static function onGetPreferences( User $user, array &$prefs ) {
$settings = WikibaseClient::getDefaultInstance()->getSettings();
 
if ( !$settings->getSetting( 'showExternalRecentChanges' ) ) {
-   return true;
+   return;
}
 
$prefs['rcshowwikidata'] = [
@@ -231,21 +207,15 @@
'label-message' => 
'wikibase-watchlist-show-changes-pref',
'section' => 'watchlist/advancedwatchlist',
];
-
-   return true;
}
 
/**
 * Register the parser functions.
 *
 * @param Parser $parser
-*
-* @return bool
 */
public static function onParserFirstCallInit( Parser &$parser ) {

WikibaseClient::getDefaultInstance()->getParserFunctionRegistrant()->register( 
$parser );
-
-   

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove not needed CentralIdLookupFactory::getInstance

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402800 )

Change subject: Remove not needed CentralIdLookupFactory::getInstance
..

Remove not needed CentralIdLookupFactory::getInstance

This method makes it look like this class is following the singleton
pattern, but it isn't (and shouldn't). I assume it was introduced for
convenience. But the (almost) same can be achieved with a pair of
brackets.

Change-Id: If0538f8894bab31ff73ce5a5266822b7f6af2193
---
M client/includes/WikibaseClient.php
M lib/includes/Changes/CentralIdLookupFactory.php
M repo/Wikibase.hooks.php
M repo/includes/WikibaseRepo.php
4 files changed, 3 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/00/402800/1

diff --git a/client/includes/WikibaseClient.php 
b/client/includes/WikibaseClient.php
index 3d9748b..2d2493f 100644
--- a/client/includes/WikibaseClient.php
+++ b/client/includes/WikibaseClient.php
@@ -1184,7 +1184,7 @@
$this->siteLookup,
$this->settings->getSetting( 'siteGlobalID' )
),
-   
CentralIdLookupFactory::getInstance()->getCentralIdLookup()
+   ( new CentralIdLookupFactory() )->getCentralIdLookup()
);
}
 
diff --git a/lib/includes/Changes/CentralIdLookupFactory.php 
b/lib/includes/Changes/CentralIdLookupFactory.php
index 4abc085..8e7b07d 100644
--- a/lib/includes/Changes/CentralIdLookupFactory.php
+++ b/lib/includes/Changes/CentralIdLookupFactory.php
@@ -12,15 +12,6 @@
 class CentralIdLookupFactory {
 
/**
-* Returns an instance of the factory
-*
-* @return CentralIdLookupFactory
-*/
-   public static function getInstance() {
-   return new CentralIdLookupFactory();
-   }
-
-   /**
 * Returns a CentralIdLookup that is safe to use for cross-wiki 
propagation, or
 * null.
 *
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index d56e039..915365d 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -339,7 +339,7 @@
if ( $change ) {
$changeStore = 
WikibaseRepo::getDefaultInstance()->getStore()->getChangeStore();
 
-   $centralIdLookup = 
CentralIdLookupFactory::getInstance()->getCentralIdLookup();
+   $centralIdLookup = ( new 
CentralIdLookupFactory() )->getCentralIdLookup();
if ( $centralIdLookup === null ) {
$centralUserId = 0;
} else {
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index 8697d04..8c0990d 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -1258,7 +1258,7 @@
return new ChangeNotifier(
$this->getEntityChangeFactory(),
$transmitters,
-   
CentralIdLookupFactory::getInstance()->getCentralIdLookup()
+   ( new CentralIdLookupFactory() )->getCentralIdLookup()
);
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0538f8894bab31ff73ce5a5266822b7f6af2193
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Use "self" references instead of repeating the class name

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402799 )

Change subject: Use "self" references instead of repeating the class name
..

Use "self" references instead of repeating the class name

Change-Id: Ief5d859b31caae9d7b18c508e05c9e641110a638
---
M client/includes/Hooks/EditActionHookHandler.php
M client/includes/WikibaseClient.php
M lib/includes/Settings.php
M repo/includes/Content/EntityContent.php
4 files changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/99/402799/1

diff --git a/client/includes/Hooks/EditActionHookHandler.php 
b/client/includes/Hooks/EditActionHookHandler.php
index 3332bbf..65a226a 100644
--- a/client/includes/Hooks/EditActionHookHandler.php
+++ b/client/includes/Hooks/EditActionHookHandler.php
@@ -59,7 +59,7 @@
 
/**
 * @param IContextSource $context
-* @return EditActionHookHandler
+* @return self
 */
public static function newFromGlobalState( IContextSource $context ) {
$wikibaseClient = WikibaseClient::getDefaultInstance();
diff --git a/client/includes/WikibaseClient.php 
b/client/includes/WikibaseClient.php
index 3d9748b..f39f348 100644
--- a/client/includes/WikibaseClient.php
+++ b/client/includes/WikibaseClient.php
@@ -635,7 +635,7 @@
 * IMPORTANT: Use only when it is not feasible to inject an instance 
properly.
 *
 * @throws MWException
-* @return WikibaseClient
+* @return self
 */
private static function newInstance() {
global $wgWBClientDataTypes;
@@ -697,7 +697,7 @@
 *
 * @param string $reset Flag: Pass "reset" to reset the default instance
 *
-* @return WikibaseClient
+* @return self
 */
public static function getDefaultInstance( $reset = 'noreset' ) {
static $instance = null;
diff --git a/lib/includes/Settings.php b/lib/includes/Settings.php
index cbe21aa..8e15c52 100644
--- a/lib/includes/Settings.php
+++ b/lib/includes/Settings.php
@@ -17,7 +17,7 @@
/**
 * @deprecated
 *
-* @return Settings
+* @return self
 */
public static function singleton() {
static $instance = null;
diff --git a/repo/includes/Content/EntityContent.php 
b/repo/includes/Content/EntityContent.php
index bfe1061..b858d23 100644
--- a/repo/includes/Content/EntityContent.php
+++ b/repo/includes/Content/EntityContent.php
@@ -534,11 +534,11 @@
/**
 * Returns a diff between this EntityContent and the given 
EntityContent.
 *
-* @param EntityContent $toContent
+* @param self $toContent
 *
 * @return EntityContentDiff
 */
-   public function getDiff( EntityContent $toContent ) {
+   public function getDiff( self $toContent ) {
$fromContent = $this;
 
$differ = new MapDiffer();
@@ -564,7 +564,7 @@
 * @param EntityContentDiff $patch
 *
 * @throws PatcherException
-* @return EntityContent
+* @return self
 */
public function getPatchedCopy( EntityContentDiff $patch ) {
/* @var EntityHandler $handler */
@@ -643,7 +643,7 @@
/**
 * @see Content::copy
 *
-* @return EntityContent
+* @return self
 */
public function copy() {
/* @var EntityHandler $handler */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief5d859b31caae9d7b18c508e05c9e641110a638
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] data-values/value-view[master]: Use Daniel Werners preferred email address

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402796 )

Change subject: Use Daniel Werners preferred email address
..

Use Daniel Werners preferred email address

I contacted Daniel Werner and asked him which email address he preferrs.
I had two reasons to touch this:
* Daniels wikimedia.de email does not exist any more.
* He used so many different @author tags and I wanted to unify them.

Change-Id: Iba30a8202341f61bcf4290c84e230c49cc6d9472
---
M i18n/en.json
M i18n/qqq.json
M lib/jquery.ui/jquery.ui.inputextender.js
M lib/jquery.ui/jquery.ui.toggler.css
M lib/jquery.ui/jquery.ui.toggler.js
M lib/jquery/jquery.animateWithEvent.js
M lib/util/util.Notifier.js
M src/experts/CommonsMediaType.js
M src/experts/EmptyValue.css
M src/experts/EmptyValue.js
M src/experts/GeoShape.js
M src/experts/GlobeCoordinateInput.js
M src/experts/StringValue.js
M src/experts/SuggestedStringValue.js
M src/experts/TimeInput.js
M src/experts/UnDeserializableValue.js
M src/experts/UnsupportedValue.css
M src/experts/UnsupportedValue.js
M src/jquery.valueview.Expert.js
M src/jquery.valueview.ViewState.js
M src/jquery.valueview.valueview.css
M src/jquery.valueview.valueview.js
M tests/lib/jquery.ui/jquery.ui.inputextender.tests.js
M tests/lib/jquery/jquery.AnimationEvent.tests.js
M tests/lib/jquery/jquery.PurposedCallbacks.tests.js
M tests/lib/jquery/jquery.animateWithEvent.tests.js
M tests/lib/util/util.Notifier.tests.js
M tests/src/experts/StringValue.tests.js
M tests/src/experts/TimeInput.tests.js
M tests/src/jquery.valueview.ExpertStore.tests.js
M tests/src/jquery.valueview.tests.MockExpert.js
M tests/src/jquery.valueview.tests.MockViewState.js
M tests/src/jquery.valueview.tests.MockViewState.tests.js
M tests/src/jquery.valueview.tests.testExpert.js
34 files changed, 35 insertions(+), 35 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/data-values/value-view 
refs/changes/96/402796/1

diff --git a/i18n/en.json b/i18n/en.json
index cd3ffd0..ee5c889 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Daniel Werner < daniel.wer...@wikimedia.de >",
+   "Daniel Werner < daniel.a.r.wer...@gmail.com >",
"H. Snater < mediaw...@snater.com >"
]
},
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 6c083b3..8fc8dd6 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -2,7 +2,7 @@
"@metadata": {
"authors": [
"Amire80",
-   "Daniel Werner < daniel.wer...@wikimedia.de >",
+   "Daniel Werner < daniel.a.r.wer...@gmail.com >",
"H. Snater < mediaw...@snater.com >",
"Shirayuki",
"Liuxinyu970226",
diff --git a/lib/jquery.ui/jquery.ui.inputextender.js 
b/lib/jquery.ui/jquery.ui.inputextender.js
index e082841..ebc2655 100644
--- a/lib/jquery.ui/jquery.ui.inputextender.js
+++ b/lib/jquery.ui/jquery.ui.inputextender.js
@@ -54,7 +54,7 @@
  * @uses jQuery.ui
  * @license GNU GPL v2+
  * @author H. Snater < mediaw...@snater.com >
- * @author Daniel Werner < daniel.wer...@wikimedia.de >
+ * @author Daniel Werner < daniel.a.r.wer...@gmail.com >
  *
  * @constructor
  *
diff --git a/lib/jquery.ui/jquery.ui.toggler.css 
b/lib/jquery.ui/jquery.ui.toggler.css
index 411f6f7..018ea33 100644
--- a/lib/jquery.ui/jquery.ui.toggler.css
+++ b/lib/jquery.ui/jquery.ui.toggler.css
@@ -1,7 +1,7 @@
 /**
  * @license GNU GPL v2+
  * @author H. Snater < mediaw...@snater.com >
- * @author Daniel Werner < danwe...@web.de >
+ * @author Daniel Werner < daniel.a.r.wer...@gmail.com >
  */
 
 .ui-toggler.ui-state-default {
diff --git a/lib/jquery.ui/jquery.ui.toggler.js 
b/lib/jquery.ui/jquery.ui.toggler.js
index c746d50..0d1a5b3 100644
--- a/lib/jquery.ui/jquery.ui.toggler.js
+++ b/lib/jquery.ui/jquery.ui.toggler.js
@@ -43,7 +43,7 @@
  * @uses jQuery.animateWithEvent
  * @license GNU GPL v2+
  * @author H. Snater < mediaw...@snater.com >
- * @author Daniel Werner < danwe...@web.de >
+ * @author Daniel Werner < daniel.a.r.wer...@gmail.com >
  *
  * @constructor
  *
diff --git a/lib/jquery/jquery.animateWithEvent.js 
b/lib/jquery/jquery.animateWithEvent.js
index e62b7dd..7cf612c 100644
--- a/lib/jquery/jquery.animateWithEvent.js
+++ b/lib/jquery/jquery.animateWithEvent.js
@@ -25,7 +25,7 @@
 * @method animateWithEvent
 * @uses jQuery.AnimationEvent
 * @license GNU GPL v2+
-* @author Daniel Werner < daniel.wer...@wikimedia.de >
+* @author Daniel Werner < daniel.a.r.wer...@gmail.com >
 *
 * @constructor
 *
diff --git a/lib/util/util.Notifier.js b/lib/util/util.Notifier.js
index 3d78d62..0e21e9e 100644
--- a/lib/util/util.Notifier.js
+++ b/lib/util/util.Notifier.js
@@ -29,7 +29,7 @@
 *
 

[MediaWiki-commits] [Gerrit] wikibase/javascript-api[master]: Use Daniel Werners preferred email address

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402795 )

Change subject: Use Daniel Werners preferred email address
..

Use Daniel Werners preferred email address

I contacted Daniel Werner and asked him which email address he preferrs.
I had two reasons to touch this:
* Daniels wikimedia.de email does not exist any more.
* He used so many different @author tags and I wanted to unify them.

Change-Id: I80635e0f38cd7dea3d4761161439d53a192fb813
---
M src/RepoApi.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikibase/javascript-api 
refs/changes/95/402795/1

diff --git a/src/RepoApi.js b/src/RepoApi.js
index 0c211b2..4116dfe 100644
--- a/src/RepoApi.js
+++ b/src/RepoApi.js
@@ -14,7 +14,7 @@
  * @class wikibase.api.RepoApi
  * @since 1.0
  * @license GPL-2.0+
- * @author Daniel Werner < daniel.wer...@wikimedia.de >
+ * @author Daniel Werner < daniel.a.r.wer...@gmail.com >
  * @author Tobias Gritschacher
  * @author H. Snater < mediaw...@snater.com >
  * @author Marius Hoch < h...@online.de >

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80635e0f38cd7dea3d4761161439d53a192fb813
Gerrit-PatchSet: 1
Gerrit-Project: wikibase/javascript-api
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add missing "use" to ChangeNotifier

2018-01-08 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402794 )

Change subject: Add missing "use" to ChangeNotifier
..

Add missing "use" to ChangeNotifier

This is a direct follow up for what I learned in Ie0e0612. Phan reports
this as an error because of the missing "use" clause.

I'm also streamlining this code a bit, e.g. made an unused method private
(we strictly stick to "private by default" in our code bases).

Change-Id: Iafc1d41c7718a90b0df0fbc376be85f6078172ea
---
M repo/includes/Notifications/ChangeNotifier.php
1 file changed, 14 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/94/402794/1

diff --git a/repo/includes/Notifications/ChangeNotifier.php 
b/repo/includes/Notifications/ChangeNotifier.php
index bac9b57..d8ee0d2 100644
--- a/repo/includes/Notifications/ChangeNotifier.php
+++ b/repo/includes/Notifications/ChangeNotifier.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Repo\Notifications;
 
+use CentralIdLookup;
 use InvalidArgumentException;
 use Revision;
 use User;
@@ -38,10 +39,14 @@
 * @param EntityChangeFactory $changeFactory
 * @param ChangeTransmitter[] $changeTransmitters
 * @param CentralIdLookup|null $centralIdLookup CentralIdLookup, or 
null if
-*   this repository is not connected to a central user system (see
-*   Wikibase\Lib\Changes\CentralIdLookupFactory).
+*   this repository is not connected to a central user system,
+*   @see Wikibase\Lib\Changes\CentralIdLookupFactory.
 */
-   public function __construct( EntityChangeFactory $changeFactory, array 
$changeTransmitters, $centralIdLookup ) {
+   public function __construct(
+   EntityChangeFactory $changeFactory,
+   array $changeTransmitters,
+   CentralIdLookup $centralIdLookup = null
+   ) {
Assert::parameterElementType(
ChangeTransmitter::class,
$changeTransmitters,
@@ -50,10 +55,6 @@
 
$this->changeFactory = $changeFactory;
$this->changeTransmitters = $changeTransmitters;
-
-   // There is no type hint because it is a required parameter 
that allows
-   // nulls.
-   Assert::parameterType( 'CentralIdLookup|null', 
$centralIdLookup, '$centralIdLookup' );
$this->centralIdLookup = $centralIdLookup;
}
 
@@ -193,19 +194,16 @@
}
 
/**
-* Gets central user ID, or 0, from user
-*
 * @param User $user Repository user
+*
 * @return int Central user ID, or 0
 */
-   protected function getCentralUserId( User $user ) {
-   if ( $this->centralIdLookup === null ) {
-   return 0;
-   } else {
-   return $this->centralIdLookup->centralIdFromLocalUser(
-   $user
-   );
+   private function getCentralUserId( User $user ) {
+   if ( $this->centralIdLookup ) {
+   return $this->centralIdLookup->centralIdFromLocalUser( 
$user );
}
+
+   return 0;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafc1d41c7718a90b0df0fbc376be85f6078172ea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Type hint against DbFactory instead of IDatabase

2018-01-06 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402592 )

Change subject: Type hint against DbFactory instead of IDatabase
..

Type hint against DbFactory instead of IDatabase

Change-Id: I0bca260618a8f199a4206af145a6746582d6d714
---
M Hooks.php
M maintenance/FlowAddMissingModerationLogs.php
M maintenance/FlowExternalStoreMoveCluster.php
M maintenance/FlowFixUserIp.php
M maintenance/FlowFixWorkflowLastUpdateTimestamp.php
M maintenance/FlowPopulateLinksTables.php
M maintenance/FlowSetUserIp.php
M maintenance/FlowUpdateRevisionTypeId.php
M tests/phpunit/Repository/TreeRepositoryDbTest.php
9 files changed, 17 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/92/402592/1

diff --git a/Hooks.php b/Hooks.php
index 249323b..e81bab1 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -3,6 +3,7 @@
 use Flow\Collection\PostCollection;
 use Flow\Container;
 use Flow\Conversion\Utils;
+use Flow\DbFactory;
 use Flow\Exception\FlowException;
 use Flow\Exception\PermissionException;
 use Flow\Data\Listener\RecentChangesListener;
@@ -14,7 +15,6 @@
 use Flow\TalkpageManager;
 use Flow\WorkflowLoader;
 use Flow\WorkflowLoaderFactory;
-use Wikimedia\Rdbms\IDatabase;
 
 class FlowHooks {
/**
@@ -1869,8 +1869,8 @@
return true;
}
 
+   /** @var DbFactory $dbFactory */
$dbFactory = Container::get( 'db.factory' );
-   /** @var IDatabase $dbr */
$dbr = $dbFactory->getDB( DB_REPLICA );
 
// if a username is specified, search only for that user
diff --git a/maintenance/FlowAddMissingModerationLogs.php 
b/maintenance/FlowAddMissingModerationLogs.php
index 1ae3807..24f4244 100644
--- a/maintenance/FlowAddMissingModerationLogs.php
+++ b/maintenance/FlowAddMissingModerationLogs.php
@@ -1,9 +1,9 @@
 getDb( DB_MASTER );
 
$storage = $container['storage'];
diff --git a/maintenance/FlowExternalStoreMoveCluster.php 
b/maintenance/FlowExternalStoreMoveCluster.php
index 107df68..192aca2 100644
--- a/maintenance/FlowExternalStoreMoveCluster.php
+++ b/maintenance/FlowExternalStoreMoveCluster.php
@@ -1,6 +1,7 @@
 storage = $storage = Container::get( 'storage' );
+   /** @var DbFactory $dbf */
$dbf = Container::get( 'db.factory' );
-   /** @var IDatabase $dbw */
$dbw = $dbf->getDB( DB_MASTER );
 
$runUpdate = function ( $callback ) use ( $dbf, $dbw, $storage 
) {
diff --git a/maintenance/FlowFixWorkflowLastUpdateTimestamp.php 
b/maintenance/FlowFixWorkflowLastUpdateTimestamp.php
index e02857a..ee08ee0 100644
--- a/maintenance/FlowFixWorkflowLastUpdateTimestamp.php
+++ b/maintenance/FlowFixWorkflowLastUpdateTimestamp.php
@@ -2,6 +2,7 @@
 
 use Flow\Container;
 use Flow\Data\ManagerGroup;
+use Flow\DbFactory;
 use Flow\Exception\FlowException;
 use Flow\Model\AbstractRevision;
 use Flow\Model\PostRevision;
@@ -36,6 +37,7 @@
public function execute() {
global $wgFlowCluster;
 
+   /** @var DbFactory $dbFactory */
$dbFactory = Container::get( 'db.factory' );
$storage = Container::get( 'storage' );
$rootPostLoader = Container::get( 'loader.root_post' );
diff --git a/maintenance/FlowPopulateLinksTables.php 
b/maintenance/FlowPopulateLinksTables.php
index 769c644..4f0b09a 100644
--- a/maintenance/FlowPopulateLinksTables.php
+++ b/maintenance/FlowPopulateLinksTables.php
@@ -1,6 +1,7 @@
 mBatchSize;
$id = '';
+   /** @var DbFactory $dbf */
$dbf = Container::get( 'db.factory' );
$dbr = $dbf->getDB( DB_REPLICA );
while ( $count === $this->mBatchSize ) {
diff --git a/maintenance/FlowSetUserIp.php b/maintenance/FlowSetUserIp.php
index f32541c..bbb25fa 100644
--- a/maintenance/FlowSetUserIp.php
+++ b/maintenance/FlowSetUserIp.php
@@ -1,6 +1,7 @@
 getDB( DB_MASTER );
$hasRun = false;
diff --git a/maintenance/FlowUpdateRevisionTypeId.php 
b/maintenance/FlowUpdateRevisionTypeId.php
index d9e7dbd..0ac5ae3 100644
--- a/maintenance/FlowUpdateRevisionTypeId.php
+++ b/maintenance/FlowUpdateRevisionTypeId.php
@@ -1,6 +1,7 @@
 mBatchSize;
+   /** @var DbFactory $dbFactory */
$dbFactory = Container::get( 'db.factory' );
$dbr = $dbFactory->getDB( DB_REPLICA );
$dbw = $dbFactory->getDB( DB_MASTER );
diff --git a/tests/phpunit/Repository/TreeRepositoryDbTest.php 
b/tests/phpunit/Repository/TreeRepositoryDbTest.php
index cb34482..b195aab 100644
--- a/tests/phpunit/Repository/TreeRepositoryDbTest.php
+++ b/tests/phpunit/Repository/TreeRepositoryDbTest.php
@@ -26,6 +26,7 @@
$cache[] = $this->getCache();
$cache[] = $this->getCache();
 

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Remove obsolete text from self-explaining code

2018-01-06 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402586 )

Change subject: Remove obsolete text from self-explaining code
..

Remove obsolete text from self-explaining code

Change-Id: I6a29891383a6d76b26d566b980f6253d1ec0bf44
---
M Hooks.php
M includes/Conversion/Utils.php
M includes/Data/Listener/RecentChangesListener.php
M includes/Notifications/Controller.php
M includes/Notifications/FlowPresentationModel.php
M includes/OOUI/BoardDescriptionWidget.php
6 files changed, 8 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/86/402586/1

diff --git a/Hooks.php b/Hooks.php
index ec52bfd..4c13761 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -180,7 +180,7 @@
/**
 * Hook: LoadExtensionSchemaUpdates
 *
-* @param DatabaseUpdater $updater DatabaseUpdater object
+* @param DatabaseUpdater $updater
 * @return bool true in all cases
 */
public static function getSchemaUpdates( DatabaseUpdater $updater ) {
@@ -1132,7 +1132,7 @@
/**
 * Add topiclist sortby to preferences.
 *
-* @param User $user User object
+* @param User $user
 * @param array &$preferences Preferences object
 * @return bool
 */
diff --git a/includes/Conversion/Utils.php b/includes/Conversion/Utils.php
index 528065e..232544c 100644
--- a/includes/Conversion/Utils.php
+++ b/includes/Conversion/Utils.php
@@ -407,7 +407,7 @@
 * Handler for FlowAddModules, avoids rest of Flow having to be aware if
 * Parsoid is in use.
 *
-* @param OutputPage $out OutputPage object
+* @param OutputPage $out
 * @return bool
 */
public static function onFlowAddModules( OutputPage $out ) {
diff --git a/includes/Data/Listener/RecentChangesListener.php 
b/includes/Data/Listener/RecentChangesListener.php
index cfe173a..6edc98e 100644
--- a/includes/Data/Listener/RecentChangesListener.php
+++ b/includes/Data/Listener/RecentChangesListener.php
@@ -41,7 +41,7 @@
/**
 * @param FlowActions $actions
 * @param UserNameBatch $usernames
-* @param RecentChangeFactory $rcFactory Creates mw RecentChange 
instances
+* @param RecentChangeFactory $rcFactory
 * @param IRCLineUrlFormatter $ircFormatter
 */
public function __construct(
@@ -57,7 +57,7 @@
}
 
/**
-* @param AbstractRevision $revision Revision object
+* @param AbstractRevision $revision
 * @param array $row Revision row
 * @param array $metadata
 */
diff --git a/includes/Notifications/Controller.php 
b/includes/Notifications/Controller.php
index c65dac9..bb0a7bb 100644
--- a/includes/Notifications/Controller.php
+++ b/includes/Notifications/Controller.php
@@ -492,7 +492,7 @@
/**
 * @param AbstractRevision $content The (post|topic|header) revision 
that contains the content of the mention
 * @param PostRevision|null $topic Topic PostRevision object, if 
relevant (e.g. not for Header)
-* @param Workflow $workflow Workflow object
+* @param Workflow $workflow
 * @param User $user User who created the new post
 * @param array $mentionedUsers
 * @param bool $mentionsSkipped Were mentions skipped due to too many 
mentions being attempted?
diff --git a/includes/Notifications/FlowPresentationModel.php 
b/includes/Notifications/FlowPresentationModel.php
index 67d31db..0258b60 100644
--- a/includes/Notifications/FlowPresentationModel.php
+++ b/includes/Notifications/FlowPresentationModel.php
@@ -76,8 +76,8 @@
/**
 * Get the topic title Title
 *
-* @param string $fragment Optional fragment
-* @return Title Topic title
+* @param string $fragment
+* @return Title
 */
protected function getTopicTitleObj( $fragment = '' ) {
$workflowId = $this->event->getExtraParam( 'topic-workflow' );
diff --git a/includes/OOUI/BoardDescriptionWidget.php 
b/includes/OOUI/BoardDescriptionWidget.php
index e80ceb0..1bc546d 100644
--- a/includes/OOUI/BoardDescriptionWidget.php
+++ b/includes/OOUI/BoardDescriptionWidget.php
@@ -9,7 +9,6 @@
protected $description = '';
 
public function __construct( array $config = [] ) {
-   // Parent constructor
parent::__construct( $config );
 
if ( isset( $config['description'] ) ) {
@@ -20,7 +19,6 @@
$editLink = $config['editLink'];
}
 
-   // Edit button
$this->editButton = new \OOUI\ButtonWidget( [
'framed' => false,
'href' => $editLink,

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

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Use namespaced version of ResultWrapper

2018-01-06 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402585 )

Change subject: Use namespaced version of ResultWrapper
..

Use namespaced version of ResultWrapper

Change-Id: I5f6acd431f20035c5c0f20642707d8a21fbd2659
---
M includes/Formatter/AbstractQuery.php
M includes/Formatter/ContributionsQuery.php
M includes/Search/Iterators/AbstractIterator.php
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/85/402585/1

diff --git a/includes/Formatter/AbstractQuery.php 
b/includes/Formatter/AbstractQuery.php
index b608abc..2ac0cc2 100644
--- a/includes/Formatter/AbstractQuery.php
+++ b/includes/Formatter/AbstractQuery.php
@@ -11,7 +11,7 @@
 use Flow\Model\UUID;
 use Flow\Model\Workflow;
 use Flow\Repository\TreeRepository;
-use ResultWrapper;
+use Wikimedia\Rdbms\ResultWrapper;
 
 /**
  * Base class that collects the data necessary to utilize AbstractFormatter
diff --git a/includes/Formatter/ContributionsQuery.php 
b/includes/Formatter/ContributionsQuery.php
index 8475282..49e90e3 100644
--- a/includes/Formatter/ContributionsQuery.php
+++ b/includes/Formatter/ContributionsQuery.php
@@ -14,8 +14,8 @@
 use Flow\Repository\TreeRepository;
 use Flow\Exception\FlowException;
 use Flow\FlowActions;
-use ResultWrapper;
 use User;
+use Wikimedia\Rdbms\ResultWrapper;
 
 class ContributionsQuery extends AbstractQuery {
 
diff --git a/includes/Search/Iterators/AbstractIterator.php 
b/includes/Search/Iterators/AbstractIterator.php
index b42a376..d072f44 100644
--- a/includes/Search/Iterators/AbstractIterator.php
+++ b/includes/Search/Iterators/AbstractIterator.php
@@ -9,8 +9,8 @@
 use Flow\Model\AbstractRevision;
 use Flow\Model\UUID;
 use Iterator;
-use ResultWrapper;
 use stdClass;
+use Wikimedia\Rdbms\ResultWrapper;
 
 abstract class AbstractIterator implements Iterator {
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f6acd431f20035c5c0f20642707d8a21fbd2659
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Minor fixups to documentation, imports, and such

2018-01-06 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402584 )

Change subject: Minor fixups to documentation, imports, and such
..

Minor fixups to documentation, imports, and such

This patch contains a bunch of minor improvements that are not really
worth their own patches. Please tell me if you disagree, and which
changes I should split to seperate patches.

Change-Id: Ib6a53a5b216498aa92085c46d5f13e45be04fb64
---
M includes/CentralAuthGroupMembershipProxy.php
M includes/CentralAuthHooks.php
M includes/CentralAuthPrimaryAuthenticationProvider.php
M includes/LocalRenameJob/LocalRenameUserJob.php
M includes/LocalRenameJob/LocalUserMergeJob.php
M includes/session/CentralAuthTokenSessionProvider.php
M includes/specials/SpecialGlobalRenameQueue.php
M includes/specials/SpecialGlobalRenameRequest.php
M tests/phpunit/CentralAuthTestUser.php
9 files changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/84/402584/1

diff --git a/includes/CentralAuthGroupMembershipProxy.php 
b/includes/CentralAuthGroupMembershipProxy.php
index 7f1ea72..0dce775 100644
--- a/includes/CentralAuthGroupMembershipProxy.php
+++ b/includes/CentralAuthGroupMembershipProxy.php
@@ -96,7 +96,7 @@
 
/**
 * Replaces User::getGroupMemberships()
-* @return array Associative array of (group name => 
UserGroupMembership object)
+* @return UserGroupMembership[] Associative array of (group name => 
UserGroupMembership object)
 */
function getGroupMemberships() {
$groups = $this->getGroups();
diff --git a/includes/CentralAuthHooks.php b/includes/CentralAuthHooks.php
index d56268b..b84cb05 100644
--- a/includes/CentralAuthHooks.php
+++ b/includes/CentralAuthHooks.php
@@ -1275,7 +1275,7 @@
/**
 * Check whether the user's preferences are such that a UI reload is
 * recommended.
-* @param User $user User
+* @param User $user
 * @return bool
 */
public static function isUIReloadRecommended( User $user ) {
diff --git a/includes/CentralAuthPrimaryAuthenticationProvider.php 
b/includes/CentralAuthPrimaryAuthenticationProvider.php
index 9540c29..1291faa 100644
--- a/includes/CentralAuthPrimaryAuthenticationProvider.php
+++ b/includes/CentralAuthPrimaryAuthenticationProvider.php
@@ -120,7 +120,7 @@
}
 
$status = $this->checkPasswordValidity( $username, 
$req->password );
-   if ( !$status->isOk() ) {
+   if ( !$status->isOK() ) {
// Fatal, can't log in
return AuthenticationResponse::newFail( 
$status->getMessage() );
}
@@ -393,7 +393,7 @@
$options += [ 'flags' => User::READ_NORMAL ];
 
$status = parent::testUserForCreation( $user, $autocreate, 
$options );
-   if ( !$status->isOk() ) {
+   if ( !$status->isOK() ) {
return $status;
}
 
diff --git a/includes/LocalRenameJob/LocalRenameUserJob.php 
b/includes/LocalRenameJob/LocalRenameUserJob.php
index 3a1cb8b..3a3b347 100644
--- a/includes/LocalRenameJob/LocalRenameUserJob.php
+++ b/includes/LocalRenameJob/LocalRenameUserJob.php
@@ -1,6 +1,6 @@
 addModules( 'ext.centralauth.globalrenamequeue' );
 
$status = $form->show();
-   if ( $status instanceof Status && $status->isOk() ) {
+   if ( $status instanceof Status && $status->isOK() ) {
$this->getOutput()->redirect(
$this->getPageTitle(
self::PAGE_PROCESS_REQUEST . 
"/{$req->getId()}/{$status->value}"
diff --git a/includes/specials/SpecialGlobalRenameRequest.php 
b/includes/specials/SpecialGlobalRenameRequest.php
index c9c7cc6..0e5ee35 100644
--- a/includes/specials/SpecialGlobalRenameRequest.php
+++ b/includes/specials/SpecialGlobalRenameRequest.php
@@ -207,7 +207,7 @@
protected function suggestedUsername() {
do {
$rand = $this->getUser()->getName() . rand( 123, 999 );
-   } while ( !GlobalRenameRequest::isNameAvailable( $rand 
)->isOk() );
+   } while ( !GlobalRenameRequest::isNameAvailable( $rand 
)->isOK() );
return $rand;
}
 
diff --git a/tests/phpunit/CentralAuthTestUser.php 
b/tests/phpunit/CentralAuthTestUser.php
index bfcd948..c926d7b 100644
--- a/tests/phpunit/CentralAuthTestUser.php
+++ b/tests/phpunit/CentralAuthTestUser.php
@@ -77,7 +77,7 @@
private $createLocal;
 
/**
-* @param string $username the username
+* @param string $username
 * @param string $password password for the account
 * @param array $attrs associative array of global user attributs

[MediaWiki-commits] [Gerrit] mediawiki...EducationProgram[master]: Remove redundant @since tags

2018-01-03 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401727 )

Change subject: Remove redundant @since tags
..

Remove redundant @since tags

These @since tags are duplicated in so far that the entire file was
introduced with this version.

Change-Id: I2541809c4bafae6f1c74b0fbc149701bd381aca4
---
M EducationProgram.hooks.php
M includes/ArticleAdder.php
M includes/ArticleStore.php
M includes/DYKBox.php
M includes/DiffTable.php
M includes/Events/EditEventCreator.php
M includes/Events/Event.php
M includes/Events/EventGrouper.php
M includes/Events/EventQuery.php
M includes/Events/EventStore.php
M includes/Events/RecentPageEventGrouper.php
M includes/Events/Timeline.php
M includes/Events/TimelineGroup.php
M includes/Extension.php
M includes/FailForm.php
M includes/IRole.php
M includes/LogFormatter.php
M includes/Menu.php
M includes/RevisionAction.php
M includes/RoleObject.php
M includes/Settings.php
M includes/UPCUserCourseFinder.php
M includes/UserCourseFinder.php
M includes/Utils.php
M includes/actions/Action.php
M includes/actions/DeleteAction.php
M includes/actions/EditAction.php
M includes/actions/EditCourseAction.php
M includes/actions/EditOrgAction.php
M includes/actions/HistoryAction.php
M includes/actions/RestoreAction.php
M includes/actions/UndeleteAction.php
M includes/actions/UndoAction.php
M includes/actions/ViewAction.php
M includes/actions/ViewCourseAction.php
M includes/actions/ViewCourseActivityAction.php
M includes/actions/ViewOrgAction.php
M includes/api/ApiDeleteEducation.php
M includes/api/ApiEnlist.php
M includes/api/ApiRefreshEducation.php
M includes/pagers/ArticleTable.php
M includes/pagers/CoursePager.php
M includes/pagers/EPPager.php
M includes/pagers/OAPager.php
M includes/pagers/OrgPager.php
M includes/pagers/RevisionPager.php
M includes/pagers/StudentActivityPager.php
M includes/pagers/StudentPager.php
M includes/pages/CoursePage.php
M includes/pages/EducationPage.php
M includes/pages/OrgPage.php
M includes/rows/CA.php
M includes/rows/Course.php
M includes/rows/EPArticle.php
M includes/rows/EPRevision.php
M includes/rows/Instructor.php
M includes/rows/OA.php
M includes/rows/Org.php
M includes/rows/PageObject.php
M includes/rows/RevisionedObject.php
M includes/rows/Student.php
M includes/specials/SpecialAmbassadorProfile.php
M includes/specials/SpecialCAProfile.php
M includes/specials/SpecialCAs.php
M includes/specials/SpecialCourses.php
M includes/specials/SpecialDisenroll.php
M includes/specials/SpecialEducationProgram.php
M includes/specials/SpecialEnroll.php
M includes/specials/SpecialInstitutions.php
M includes/specials/SpecialManageCourses.php
M includes/specials/SpecialMyCourses.php
M includes/specials/SpecialOAProfile.php
M includes/specials/SpecialOAs.php
M includes/specials/SpecialStudentActivity.php
M includes/specials/SpecialStudents.php
M includes/specials/VerySpecialPage.php
M includes/tables/CAs.php
M includes/tables/Courses.php
M includes/tables/Events.php
M includes/tables/Instructors.php
M includes/tables/OAs.php
M includes/tables/Orgs.php
M includes/tables/PageTable.php
M includes/tables/Revisions.php
M includes/tables/Students.php
M maintenance/importWEPData.php
M maintenance/importWEPFromDB.php
M tests/phpunit/rows/CourseTest.php
M tests/phpunit/rows/OrgTest.php
89 files changed, 67 insertions(+), 870 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram 
refs/changes/27/401727/1

diff --git a/EducationProgram.hooks.php b/EducationProgram.hooks.php
index 0d5acb4..a1cc248 100644
--- a/EducationProgram.hooks.php
+++ b/EducationProgram.hooks.php
@@ -86,8 +86,6 @@
 * Schema update to set up the needed database tables.
 * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates
 *
-* @since 0.1
-*
 * @param DatabaseUpdater $updater
 */
public static function onSchemaUpdate( DatabaseUpdater $updater ) {
@@ -126,8 +124,6 @@
 * Called after the personal URLs have been set up, before they are 
shown.
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/PersonalUrls
 *
-* @since 0.1
-*
 * @param array &$personal_urls
 * @param Title &$title
 */
@@ -154,8 +150,6 @@
/**
 * Adds the preferences of Education Program to the list of available 
ones.
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/GetPreferences
-*
-* @since 0.1
 *
 * @param User $user
 * @param array &$preferences
@@ -190,8 +184,6 @@
 * Called to determine the class to handle the article rendering, based 
on title.
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/ArticleFromTitle
 *
-* @since 0.1
-*
 * @param Title &$title
 * @param \Article|null &$article
 */
@@ -205,8 +197,6 @@
   

[MediaWiki-commits] [Gerrit] mediawiki...EducationProgram[master]: Type hint against IDatabase instead of Database

2018-01-03 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401723 )

Change subject: Type hint against IDatabase instead of Database
..

Type hint against IDatabase instead of Database

Change-Id: Ibb067ca33fd71464d48c0144470df3d082a97cbe
---
M includes/ArticleStore.php
M includes/Events/EventStore.php
M includes/Store/CourseStore.php
M includes/UPCUserCourseFinder.php
M includes/pagers/RevisionPager.php
M includes/rows/ORMRow.php
M includes/tables/IORMTable.php
M includes/tables/ORMTable.php
8 files changed, 36 insertions(+), 36 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram 
refs/changes/23/401723/1

diff --git a/includes/ArticleStore.php b/includes/ArticleStore.php
index f08a676..9d57eb8 100644
--- a/includes/ArticleStore.php
+++ b/includes/ArticleStore.php
@@ -3,7 +3,7 @@
 namespace EducationProgram;
 
 use InvalidArgumentException;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Store for EPArticle objects.
@@ -84,7 +84,7 @@
 *
 * @since 0.3
 *
-* @return Database
+* @return IDatabase
 */
protected function getReadConnection() {
return wfGetDB( $this->readConnectionId );
@@ -96,7 +96,7 @@
 *
 * @since 0.3
 *
-* @return Database
+* @return IDatabase
 */
protected function getWriteConnection() {
return wfGetDB( DB_MASTER );
diff --git a/includes/Events/EventStore.php b/includes/Events/EventStore.php
index 507031e..b1dd839 100644
--- a/includes/Events/EventStore.php
+++ b/includes/Events/EventStore.php
@@ -3,7 +3,7 @@
 namespace EducationProgram\Events;
 
 use InvalidArgumentException;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Service via which EducationProgram events can be saved and queried.
@@ -66,7 +66,7 @@
/**
 * @since 0.3
 *
-* @return Database
+* @return IDatabase
 */
private function getReadConnection() {
return wfGetDB( $this->readConnectionId );
@@ -75,7 +75,7 @@
/**
 * @since 0.3
 *
-* @return Database
+* @return IDatabase
 */
private function getWriteConnection() {
return wfGetDB( DB_MASTER );
diff --git a/includes/Store/CourseStore.php b/includes/Store/CourseStore.php
index 4e8d236..c934b1c 100644
--- a/includes/Store/CourseStore.php
+++ b/includes/Store/CourseStore.php
@@ -6,7 +6,7 @@
 use EducationProgram\CourseNotFoundException;
 use EducationProgram\CourseTitleNotFoundException;
 use EducationProgram\Courses;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * This program is free software; you can redistribute it and/or modify
@@ -40,11 +40,11 @@
private $tableName;
 
/**
-* @var Database
+* @var IDatabase
 */
private $readDatabase;
 
-   public function __construct( $tableName, Database $readDatabase ) {
+   public function __construct( $tableName, IDatabase $readDatabase ) {
$this->readDatabase = $readDatabase;
$this->tableName = $tableName;
}
diff --git a/includes/UPCUserCourseFinder.php b/includes/UPCUserCourseFinder.php
index f5e0cf8..2296869 100644
--- a/includes/UPCUserCourseFinder.php
+++ b/includes/UPCUserCourseFinder.php
@@ -2,7 +2,7 @@
 
 namespace EducationProgram;
 
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Implementation of the UserCourseFinder interface that works by doing
@@ -39,16 +39,16 @@
/**
 * @since 0.3
 *
-* @var Database
+* @var IDatabase
 */
private $db;
 
/**
 * @since 0.3
 *
-* @param Database $db
+* @param IDatabase $db
 */
-   public function __construct( Database $db ) {
+   public function __construct( IDatabase $db ) {
$this->db = $db;
}
 
diff --git a/includes/pagers/RevisionPager.php 
b/includes/pagers/RevisionPager.php
index de96c04..a0bcab0 100644
--- a/includes/pagers/RevisionPager.php
+++ b/includes/pagers/RevisionPager.php
@@ -173,8 +173,8 @@
 * This function should be overridden to provide all parameters
 * needed for the main paged query. It returns an associative
 * array with the following elements:
-*  tables => Table(s) for passing to Database::select()
-*  fields => Field(s) for passing to Database::select(), may be *
+*  tables => Table(s) for passing to IDatabase::select()
+*  fields => Field(s) for passing to IDatabase::select(), may be *
 *  conds => WHERE conditions
 *  options => option array
 *  join_conds => JOIN conditions
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Type hint against IDatabase instead of Database

2018-01-03 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401722 )

Change subject: Type hint against IDatabase instead of Database
..

Type hint against IDatabase instead of Database

Change-Id: I4050e1e08fe084cca046f4743d19259f933ea61b
---
M client/tests/phpunit/includes/Store/Sql/PagePropsEntityIdLookupTest.php
M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
M repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php
3 files changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/22/401722/1

diff --git 
a/client/tests/phpunit/includes/Store/Sql/PagePropsEntityIdLookupTest.php 
b/client/tests/phpunit/includes/Store/Sql/PagePropsEntityIdLookupTest.php
index f991e97..1964618 100644
--- a/client/tests/phpunit/includes/Store/Sql/PagePropsEntityIdLookupTest.php
+++ b/client/tests/phpunit/includes/Store/Sql/PagePropsEntityIdLookupTest.php
@@ -7,7 +7,7 @@
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Entity\ItemIdParser;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * @covers Wikibase\Client\Store\Sql\PagePropsEntityIdLookup
@@ -34,7 +34,7 @@
return $title;
}
 
-   private function insertPageProps( Database $db, $pageId, EntityId 
$entityId ) {
+   private function insertPageProps( IDatabase $db, $pageId, EntityId 
$entityId ) {
$db->insert(
'page_props',
[
diff --git a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php 
b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
index f27d54d..3fb4c9f 100644
--- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
@@ -347,7 +347,7 @@
}
 
/**
-* @param Database $db
+* @param IDatabase $db
 * @param array $conditions
 *
 * @return bool
diff --git 
a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php 
b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php
index 4f2d989..be41a7d 100644
--- a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php
+++ b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php
@@ -15,6 +15,7 @@
 use Wikibase\Repo\WikibaseRepo;
 use Wikimedia\Rdbms\Database;
 use Wikimedia\Rdbms\FakeResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * This test needs to be in repo, although the class is in lib as we can't 
alter
@@ -104,7 +105,7 @@
/**
 * Gets a "lagged" database connection: We always leave out the first 
row on select.
 */
-   private function getLaggedDatabase( Database $realDB, $selectCount, 
$selectRowCount ) {
+   private function getLaggedDatabase( IDatabase $realDB, $selectCount, 
$selectRowCount ) {
$db = $this->getMockBuilder( Database::class )
->disableOriginalConstructor()
->setMethods( [ 'select', 'selectRow' ] )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4050e1e08fe084cca046f4743d19259f933ea61b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...PropertySuggester[master]: Type hint against IDatabase instead of Database

2018-01-03 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401721 )

Change subject: Type hint against IDatabase instead of Database
..

Type hint against IDatabase instead of Database

Change-Id: I8e2ea8167e7f7f3a41cf321e6387801e1c03c212
---
M src/UpdateTable/Importer/BasicImporter.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PropertySuggester 
refs/changes/21/401721/1

diff --git a/src/UpdateTable/Importer/BasicImporter.php 
b/src/UpdateTable/Importer/BasicImporter.php
index 1baa8e9..2e19435 100644
--- a/src/UpdateTable/Importer/BasicImporter.php
+++ b/src/UpdateTable/Importer/BasicImporter.php
@@ -4,7 +4,7 @@
 
 use UnexpectedValueException;
 use PropertySuggester\UpdateTable\ImportContext;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * A strategy which imports entries from a CSV file into a DB table. Used as 
fallback, when no
@@ -37,12 +37,12 @@
}
 
/**
-* @param $fileHandle
-* @param Database $db
+* @param resource $fileHandle
+* @param IDatabase $db
 * @param ImportContext $importContext
 * @throws UnexpectedValueException
 */
-   private function doImport( $fileHandle, Database $db, ImportContext 
$importContext ) {
+   private function doImport( $fileHandle, IDatabase $db, ImportContext 
$importContext ) {
$accumulator = [];
$batchSize = $importContext->getBatchSize();
$i = 0;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e2ea8167e7f7f3a41cf321e6387801e1c03c212
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PropertySuggester
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Use Daniel Werners preferred email address

2018-01-03 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401719 )

Change subject: Use Daniel Werners preferred email address
..

Use Daniel Werners preferred email address

I contacted Daniel Werner and asked him which email address he preferrs.
I had two reasons to touch this:
* Daniels wikimedia.de email does not exist any more.
* He used so many different @author tags and I wanted to unify them.

Change-Id: I40e21e3ca7429d15b41cf676dbf3e9c35709981c
---
M lib/includes/Modules/SitesModule.php
M lib/resources/wikibase.buildErrorOutput.js
M lib/resources/wikibase.js
M lib/resources/wikibase.sites.js
M lib/tests/qunit/wikibase.sites.tests.js
M lib/tests/qunit/wikibase.tests.js
M repo/includes/Modules/DataTypesModule.php
M repo/resources/dataTypes/wikibase.dataTypeStore.js
M repo/resources/experts/Entity.js
M repo/resources/experts/__namespace.js
M repo/resources/parsers/getApiBasedValueParserConstructor.js
M repo/resources/wikibase.ui.entityViewInit.js
M repo/tests/phpunit/includes/Modules/DataTypesModuleTest.php
M repo/tests/qunit/dataTypes/DataType.tests.js
M repo/tests/qunit/dataTypes/wikibase.dataTypeStore.tests.js
M view/lib/resources/wikibase-data-values-value-view/lib/resources.php
M view/lib/resources/wikibase-data-values-value-view/src/resources.php
M view/lib/resources/wikibase-data-values-value-view/tests/resources.php
M view/lib/resources/wikibase-data-values/lib/resources.php
M view/lib/resources/wikibase-data-values/src/resources.php
M view/lib/resources/wikibase-data-values/src/valueParsers/resources.php
M view/resources/jquery/ui/jquery.ui.TemplatedWidget.js
M view/resources/jquery/ui/jquery.ui.tagadata.js
M view/resources/jquery/wikibase/jquery.wikibase.listview.ListItemAdapter.js
M view/resources/jquery/wikibase/jquery.wikibase.listview.js
M view/resources/jquery/wikibase/jquery.wikibase.snaklistview.js
M view/resources/jquery/wikibase/jquery.wikibase.statementgrouplabelscroll.js
M view/resources/jquery/wikibase/jquery.wikibase.statementview.js
M view/resources/jquery/wikibase/snakview/snakview.SnakTypeSelector.js
M view/resources/jquery/wikibase/snakview/snakview.ViewState.js
M view/resources/jquery/wikibase/snakview/snakview.js
M view/resources/jquery/wikibase/snakview/snakview.variations.NoValue.js
M view/resources/jquery/wikibase/snakview/snakview.variations.SomeValue.js
M view/resources/jquery/wikibase/snakview/snakview.variations.Value.js
M view/resources/jquery/wikibase/snakview/snakview.variations.Variation.js
M view/resources/jquery/wikibase/snakview/snakview.variations.js
M view/resources/wikibase/store/store.js
M view/resources/wikibase/utilities/wikibase.utilities.ui.css
M view/resources/wikibase/utilities/wikibase.utilities.ui.js
M view/resources/wikibase/wikibase.getLanguageNameByCode.js
M 
view/tests/qunit/jquery/wikibase/jquery.wikibase.statementgrouplabelscroll.tests.js
M view/tests/qunit/wikibase/wikibase.getLanguageNameByCode.tests.js
42 files changed, 42 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/19/401719/1

diff --git a/lib/includes/Modules/SitesModule.php 
b/lib/includes/Modules/SitesModule.php
index ff507f1..0e5792b 100644
--- a/lib/includes/Modules/SitesModule.php
+++ b/lib/includes/Modules/SitesModule.php
@@ -10,7 +10,7 @@
 /**
  * @license GPL-2.0+
  * @author Jeroen De Dauw < jeroended...@gmail.com >
- * @author Daniel Werner < daniel.wer...@wikimedia.de >
+ * @author Daniel Werner < daniel.a.r.wer...@gmail.com >
  * @author Marius Hoch < h...@online.de >
  */
 class SitesModule extends ResourceLoaderModule {
diff --git a/lib/resources/wikibase.buildErrorOutput.js 
b/lib/resources/wikibase.buildErrorOutput.js
index 7a3b95b..9139e03 100644
--- a/lib/resources/wikibase.buildErrorOutput.js
+++ b/lib/resources/wikibase.buildErrorOutput.js
@@ -5,7 +5,7 @@
 * Generates standardized output for errors.
 *
 * @license GPL-2.0+
-* @author Daniel Werner < daniel.wer...@wikimedia.de >
+* @author Daniel Werner < daniel.a.r.wer...@gmail.com >
 *
 * @param {Error} error
 * @return {jQuery}
diff --git a/lib/resources/wikibase.js b/lib/resources/wikibase.js
index 2b4588d..6e50995 100644
--- a/lib/resources/wikibase.js
+++ b/lib/resources/wikibase.js
@@ -3,7 +3,7 @@
  * @see https://www.mediawiki.org/wiki/Extension:Wikibase
  *
  * @license GPL-2.0+
- * @author Daniel Werner < daniel.werner at wikimedia.de >
+ * @author Daniel Werner < daniel.a.r.wer...@gmail.com >
  */
 
 this.wikibase = this.wikibase || {};
diff --git a/lib/resources/wikibase.sites.js b/lib/resources/wikibase.sites.js
index 420e420..e0f4004 100644
--- a/lib/resources/wikibase.sites.js
+++ b/lib/resources/wikibase.sites.js
@@ -1,6 +1,6 @@
 /**
  * @license GPL-2.0+
- * @author Daniel Werner < daniel.werner at wikimedia.de >
+ * @author Daniel Werner < 

[MediaWiki-commits] [Gerrit] mediawiki...Cite[master]: Remove @copyright tags

2017-12-29 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400691 )

Change subject: Remove @copyright tags
..

Remove @copyright tags

These tags do have a series of problems. Among others:
* There is AUTHORS.txt repeating the authors.
* There is MIT-LICENSE.txt as well as COPYING.txt repeating the license.
* What do the @copyright tags add to what @license already states?
* Isn't it confusing to state some "copyright" in the context of a free
  license? I mean, the literal "right to copy" is not limited to these
  authors.
* To what does "Cite VisualEditor Team" even refer to?
* Is it even true that this specific team is still the main author of
  these files?

Change-Id: Ie7a208cbd2d56c8f116d0f67353a8ba01bca4a6d
---
M includes/Cite.php
M includes/CiteCSSFileModule.php
M includes/CiteDataModule.php
M includes/CiteHooks.php
M modules/ve-cite/tests/ve.dm.Converter.test.js
M modules/ve-cite/tests/ve.dm.InternalList.test.js
M modules/ve-cite/tests/ve.dm.Transaction.test.js
M modules/ve-cite/tests/ve.dm.citeExample.js
M modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js
M modules/ve-cite/ve.ce.MWReferenceNode.css
M modules/ve-cite/ve.ce.MWReferenceNode.js
M modules/ve-cite/ve.ce.MWReferencesListNode.css
M modules/ve-cite/ve.ce.MWReferencesListNode.js
M modules/ve-cite/ve.dm.MWReferenceModel.js
M modules/ve-cite/ve.dm.MWReferenceNode.js
M modules/ve-cite/ve.dm.MWReferencesListNode.js
M modules/ve-cite/ve.ui.MWCitationAction.js
M modules/ve-cite/ve.ui.MWCitationContextItem.js
M modules/ve-cite/ve.ui.MWCitationDialog.js
M modules/ve-cite/ve.ui.MWCitationDialogTool.js
M modules/ve-cite/ve.ui.MWReference.init.js
M modules/ve-cite/ve.ui.MWReferenceContextItem.css
M modules/ve-cite/ve.ui.MWReferenceContextItem.js
M modules/ve-cite/ve.ui.MWReferenceDialog.js
M modules/ve-cite/ve.ui.MWReferenceDialogTool.js
M modules/ve-cite/ve.ui.MWReferenceGroupInputWidget.css
M modules/ve-cite/ve.ui.MWReferenceGroupInputWidget.js
M modules/ve-cite/ve.ui.MWReferenceIcons.css
M modules/ve-cite/ve.ui.MWReferenceResultWidget.css
M modules/ve-cite/ve.ui.MWReferenceResultWidget.js
M modules/ve-cite/ve.ui.MWReferenceSearchWidget.css
M modules/ve-cite/ve.ui.MWReferenceSearchWidget.js
M modules/ve-cite/ve.ui.MWReferencesListCommand.js
M modules/ve-cite/ve.ui.MWReferencesListContextItem.js
M modules/ve-cite/ve.ui.MWReferencesListDialog.js
M modules/ve-cite/ve.ui.MWUseExistingReferenceCommand.js
36 files changed, 0 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite 
refs/changes/91/400691/1

diff --git a/includes/Cite.php b/includes/Cite.php
index e18d6eb..334cec7 100644
--- a/includes/Cite.php
+++ b/includes/Cite.php
@@ -18,7 +18,6 @@
  * @bug https://phabricator.wikimedia.org/T6579
  *
  * @author Ævar Arnfjörð Bjarmason 
- * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
  * @license GPL-2.0+
  */
 
diff --git a/includes/CiteCSSFileModule.php b/includes/CiteCSSFileModule.php
index 78e5b0a..820cd4b 100644
--- a/includes/CiteCSSFileModule.php
+++ b/includes/CiteCSSFileModule.php
@@ -4,7 +4,6 @@
  *
  * @file
  * @ingroup Extensions
- * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
  * @license MIT
  */
 
diff --git a/includes/CiteDataModule.php b/includes/CiteDataModule.php
index b4a741e..e4c16e8 100644
--- a/includes/CiteDataModule.php
+++ b/includes/CiteDataModule.php
@@ -6,7 +6,6 @@
  *
  * @file
  * @ingroup Extensions
- * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
  * @license MIT
  */
 
diff --git a/includes/CiteHooks.php b/includes/CiteHooks.php
index 7aae827..2aabd3d 100644
--- a/includes/CiteHooks.php
+++ b/includes/CiteHooks.php
@@ -4,7 +4,6 @@
  *
  * @file
  * @ingroup Extensions
- * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
  * @license MIT
  */
 
diff --git a/modules/ve-cite/tests/ve.dm.Converter.test.js 
b/modules/ve-cite/tests/ve.dm.Converter.test.js
index 07cfe60..b8e9508 100644
--- a/modules/ve-cite/tests/ve.dm.Converter.test.js
+++ b/modules/ve-cite/tests/ve.dm.Converter.test.js
@@ -1,7 +1,6 @@
 /*!
  * VisualEditor DataModel Cite-specific Converter tests.
  *
- * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
  * @license MIT
  */
 
diff --git a/modules/ve-cite/tests/ve.dm.InternalList.test.js 
b/modules/ve-cite/tests/ve.dm.InternalList.test.js
index 1a72ebe..afb0c95 100644
--- a/modules/ve-cite/tests/ve.dm.InternalList.test.js
+++ b/modules/ve-cite/tests/ve.dm.InternalList.test.js
@@ -1,7 +1,6 @@
 /*!
  * VisualEditor DataModel Cite-specific InternalList tests.
  *
- * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
  * @license MIT
  */
 
diff --git a/modules/ve-cite/tests/ve.dm.Transaction.test.js 
b/modules/ve-cite/tests/ve.dm.Transaction.test.js
index 5f3f8af..0b1efc8 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki...Cite[master]: Use standard form for @license tags

2017-12-29 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400690 )

Change subject: Use standard form for @license tags
..

Use standard form for @license tags

See https://spdx.org/licenses/

Change-Id: Ic091ebc3844abcd6de90b3241382fb4732200a6d
---
M includes/Cite.php
M includes/CiteCSSFileModule.php
M includes/CiteDataModule.php
M includes/CiteHooks.php
M modules/ve-cite/tests/ve.dm.Converter.test.js
M modules/ve-cite/tests/ve.dm.InternalList.test.js
M modules/ve-cite/tests/ve.dm.Transaction.test.js
M modules/ve-cite/tests/ve.dm.citeExample.js
M modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js
M modules/ve-cite/ve.ce.MWReferenceNode.css
M modules/ve-cite/ve.ce.MWReferenceNode.js
M modules/ve-cite/ve.ce.MWReferencesListNode.css
M modules/ve-cite/ve.ce.MWReferencesListNode.js
M modules/ve-cite/ve.dm.MWReferenceModel.js
M modules/ve-cite/ve.dm.MWReferenceNode.js
M modules/ve-cite/ve.dm.MWReferencesListNode.js
M modules/ve-cite/ve.ui.MWCitationAction.js
M modules/ve-cite/ve.ui.MWCitationContextItem.js
M modules/ve-cite/ve.ui.MWCitationDialog.js
M modules/ve-cite/ve.ui.MWCitationDialogTool.js
M modules/ve-cite/ve.ui.MWReference.init.js
M modules/ve-cite/ve.ui.MWReferenceContextItem.css
M modules/ve-cite/ve.ui.MWReferenceContextItem.js
M modules/ve-cite/ve.ui.MWReferenceDialog.js
M modules/ve-cite/ve.ui.MWReferenceDialogTool.js
M modules/ve-cite/ve.ui.MWReferenceGroupInputWidget.css
M modules/ve-cite/ve.ui.MWReferenceGroupInputWidget.js
M modules/ve-cite/ve.ui.MWReferenceIcons.css
M modules/ve-cite/ve.ui.MWReferenceResultWidget.css
M modules/ve-cite/ve.ui.MWReferenceResultWidget.js
M modules/ve-cite/ve.ui.MWReferenceSearchWidget.css
M modules/ve-cite/ve.ui.MWReferenceSearchWidget.js
M modules/ve-cite/ve.ui.MWReferencesListCommand.js
M modules/ve-cite/ve.ui.MWReferencesListContextItem.js
M modules/ve-cite/ve.ui.MWReferencesListDialog.js
M modules/ve-cite/ve.ui.MWUseExistingReferenceCommand.js
36 files changed, 36 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite 
refs/changes/90/400690/1

diff --git a/includes/Cite.php b/includes/Cite.php
index 02b93c5..e18d6eb 100644
--- a/includes/Cite.php
+++ b/includes/Cite.php
@@ -19,7 +19,7 @@
  *
  * @author Ævar Arnfjörð Bjarmason 
  * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
+ * @license GPL-2.0+
  */
 
 use Wikimedia\Rdbms\IDatabase;
diff --git a/includes/CiteCSSFileModule.php b/includes/CiteCSSFileModule.php
index ef945e2..78e5b0a 100644
--- a/includes/CiteCSSFileModule.php
+++ b/includes/CiteCSSFileModule.php
@@ -5,7 +5,7 @@
  * @file
  * @ingroup Extensions
  * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see LICENSE.txt
+ * @license MIT
  */
 
 class CiteCSSFileModule extends ResourceLoaderFileModule {
diff --git a/includes/CiteDataModule.php b/includes/CiteDataModule.php
index b3d36ef..b4a741e 100644
--- a/includes/CiteDataModule.php
+++ b/includes/CiteDataModule.php
@@ -7,7 +7,7 @@
  * @file
  * @ingroup Extensions
  * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see MIT-LICENSE.txt
+ * @license MIT
  */
 
 class CiteDataModule extends ResourceLoaderModule {
diff --git a/includes/CiteHooks.php b/includes/CiteHooks.php
index bcf65fd..7aae827 100644
--- a/includes/CiteHooks.php
+++ b/includes/CiteHooks.php
@@ -5,7 +5,7 @@
  * @file
  * @ingroup Extensions
  * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see MIT-LICENSE.txt
+ * @license MIT
  */
 
 class CiteHooks {
diff --git a/modules/ve-cite/tests/ve.dm.Converter.test.js 
b/modules/ve-cite/tests/ve.dm.Converter.test.js
index 65fd6ba..07cfe60 100644
--- a/modules/ve-cite/tests/ve.dm.Converter.test.js
+++ b/modules/ve-cite/tests/ve.dm.Converter.test.js
@@ -2,7 +2,7 @@
  * VisualEditor DataModel Cite-specific Converter tests.
  *
  * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see LICENSE.txt
+ * @license MIT
  */
 
 QUnit.module( 've.dm.Converter (Cite)', ve.test.utils.mwEnvironment );
diff --git a/modules/ve-cite/tests/ve.dm.InternalList.test.js 
b/modules/ve-cite/tests/ve.dm.InternalList.test.js
index 52e0adf..1a72ebe 100644
--- a/modules/ve-cite/tests/ve.dm.InternalList.test.js
+++ b/modules/ve-cite/tests/ve.dm.InternalList.test.js
@@ -2,7 +2,7 @@
  * VisualEditor DataModel Cite-specific InternalList tests.
  *
  * @copyright 2011-2017 Cite VisualEditor Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see LICENSE.txt
+ * @license MIT
  */
 
 QUnit.module( 've.dm.InternalList (Cite)', ve.test.utils.mwEnvironment );
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseMediaInfo[master]: Use trivial implementations instead of mocks, if possible

2017-12-29 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400687 )

Change subject: Use trivial implementations instead of mocks, if possible
..

Use trivial implementations instead of mocks, if possible

Mocking everything can easily become an anti-pattern. In the cases
touched in this patch we do have very trivial (in-memory) implementations
that work just fine. This makes the test setup easier to read.

Change-Id: I93fef5246767cab1b0d912df3f94c7ce0e18eb4f
---
M tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseMediaInfo 
refs/changes/87/400687/1

diff --git a/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php 
b/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
index 55c23b4..92835ba 100644
--- a/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
+++ b/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
@@ -12,7 +12,7 @@
 use RequestContext;
 use Title;
 use Wikibase\DataModel\Entity\EntityId;
-use Wikibase\DataModel\Entity\EntityIdParser;
+use Wikibase\DataModel\Entity\ItemIdParser;
 use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup;
 use Wikibase\Lib\Store\EntityContentDataCodec;
 use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory;
@@ -85,7 +85,7 @@
$this->getMockWithoutConstructor( 
EntityContentDataCodec::class ),
$this->getMockWithoutConstructor( 
EntityConstraintProvider::class ),
$this->getMock( ValidatorErrorLocalizer::class ),
-   $this->getMock( EntityIdParser::class ),
+   new ItemIdParser(),
$this->getMock( EntityIdLookup::class ),
$labelLookupFactory,
$missingMediaInfoHandler,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I93fef5246767cab1b0d912df3f94c7ce0e18eb4f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseMediaInfo
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseMediaInfo[master]: Remove default "true" from MissingMediaInfoHandler

2017-12-29 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400686 )

Change subject: Remove default "true" from MissingMediaInfoHandler
..

Remove default "true" from MissingMediaInfoHandler

Bug: T182767
Change-Id: I38f4556c3b48904149f26618175ab96cca7e6117
Depends-On: Ifc8ac520f70914c3ee5e558afc7cfe82b409b737
---
M src/Content/MissingMediaInfoHandler.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseMediaInfo 
refs/changes/86/400686/1

diff --git a/src/Content/MissingMediaInfoHandler.php 
b/src/Content/MissingMediaInfoHandler.php
index d6f606e..e6097bf 100644
--- a/src/Content/MissingMediaInfoHandler.php
+++ b/src/Content/MissingMediaInfoHandler.php
@@ -96,7 +96,7 @@
 
// show an empty MediaInfo
$outputGenerator = $this->outputGeneratorFactory->
-   getEntityParserOutputGenerator( 
$userLanguage->getCode(), true );
+   getEntityParserOutputGenerator( 
$userLanguage->getCode() );
 
$mediaInfo = new MediaInfo( $mediaInfoId );
$parserOutput = $outputGenerator->getParserOutput( $mediaInfo, 
true );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I38f4556c3b48904149f26618175ab96cca7e6117
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseMediaInfo
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Do not collapse references on diffs/old revisions

2017-12-29 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400685 )

Change subject: Do not collapse references on diffs/old revisions
..

Do not collapse references on diffs/old revisions

This fixes an other regression introduced via Ied5fe1a.

We fixed an other regression just recently, see T181807. Now I realized
we left a lot of code behind that is now entirely unused:
* The "editable" flag is always true now. It can as well be removed.
* Because of this, the EmptyEditSectionGenerator is unused.
* Because of this, the edit section string can not be empty any more.

This patch here just removes all this code.

What's left is the "initially collapsed" state depending on the number
of references. However, this must only have an effect on regular entity
pages that are neither a diff nor an old revision.

The actual fix for T182767 is in the .less file.

Splitting this patch is not impossible, but I feel the proposed solution
can be much better understood with the dead code removed.

Bug: T182767
Change-Id: Ifc8ac520f70914c3ee5e558afc7cfe82b409b737
---
M repo/includes/Content/EntityContent.php
M repo/includes/ParserOutput/EntityParserOutputGenerator.php
M repo/includes/ParserOutput/EntityParserOutputGeneratorFactory.php
M repo/resources/wikibase.ui.entityViewInit.js
M 
repo/tests/phpunit/includes/ParserOutput/EntityParserOutputGeneratorFactoryTest.php
M repo/tests/phpunit/includes/ParserOutput/EntityParserOutputGeneratorTest.php
M view/autoload.php
M view/resources/wikibase/wikibase.less
D view/src/EmptyEditSectionGenerator.php
M view/src/StatementHtmlGenerator.php
D view/tests/phpunit/EmptyEditSectionGeneratorTest.php
11 files changed, 12 insertions(+), 184 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/85/400685/1

diff --git a/repo/includes/Content/EntityContent.php 
b/repo/includes/Content/EntityContent.php
index e5605ff..bfe1061 100644
--- a/repo/includes/Content/EntityContent.php
+++ b/repo/includes/Content/EntityContent.php
@@ -262,8 +262,7 @@
$entityParserOutputGeneratorFactory = 
WikibaseRepo::getDefaultInstance()->getEntityParserOutputGeneratorFactory();
 
$outputGenerator = 
$entityParserOutputGeneratorFactory->getEntityParserOutputGenerator(
-   $options->getUserLang(),
-   true
+   $options->getUserLang()
);
 
$entityRevision = $this->getEntityRevision( $revisionId );
diff --git a/repo/includes/ParserOutput/EntityParserOutputGenerator.php 
b/repo/includes/ParserOutput/EntityParserOutputGenerator.php
index c7d92ca..f779ae5 100644
--- a/repo/includes/ParserOutput/EntityParserOutputGenerator.php
+++ b/repo/includes/ParserOutput/EntityParserOutputGenerator.php
@@ -24,7 +24,6 @@
 use Wikibase\Repo\MediaWikiLanguageDirectionalityLookup;
 use Wikibase\Repo\MediaWikiLocalizedTextProvider;
 use Wikibase\Repo\View\RepoSpecialPageLinker;
-use Wikibase\View\EmptyEditSectionGenerator;
 use Wikibase\View\LocalizedTextProvider;
 use Wikibase\View\Template\TemplateFactory;
 use Wikibase\View\TermsListView;
@@ -91,11 +90,6 @@
private $languageCode;
 
/**
-* @var bool
-*/
-   private $editable;
-
-   /**
 * @param DispatchingEntityViewFactory $entityViewFactory
 * @param ParserOutputJsConfigBuilder $configBuilder
 * @param EntityTitleLookup $entityTitleLookup
@@ -106,7 +100,6 @@
 * @param EntityDataFormatProvider $entityDataFormatProvider
 * @param ParserOutputDataUpdater[] $dataUpdaters
 * @param string $languageCode
-* @param bool $editable
 */
public function __construct(
DispatchingEntityViewFactory $entityViewFactory,
@@ -118,8 +111,7 @@
LocalizedTextProvider $textProvider,
EntityDataFormatProvider $entityDataFormatProvider,
array $dataUpdaters,
-   $languageCode,
-   $editable
+   $languageCode
) {
$this->entityViewFactory = $entityViewFactory;
$this->configBuilder = $configBuilder;
@@ -131,7 +123,6 @@
$this->entityDataFormatProvider = $entityDataFormatProvider;
$this->dataUpdaters = $dataUpdaters;
$this->languageCode = $languageCode;
-   $this->editable = $editable;
}
 
/**
@@ -293,11 +284,11 @@
$this->languageFallbackChain
);
 
-   $editSectionGenerator = $this->editable ? new 
ToolbarEditSectionGenerator(
+   $editSectionGenerator = new ToolbarEditSectionGenerator(
new RepoSpecialPageLinker(),
$this->templateFactory,
$this->textProvider
-   ) : new 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Properly load collapsible sitelinks CSS exactly when needed

2017-12-29 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400684 )

Change subject: Properly load collapsible sitelinks CSS exactly when needed
..

Properly load collapsible sitelinks CSS exactly when needed

This patch fixes a series of issues:

* The first is the placement of this CSS. It didn't really belong to
"toolbaritem". Note that the relevant "coppalsible" class is set on the
"sitelinkgroupview" template.

* This CSS is only needed on JS clients. But it's needed before the
collapsible feature kicks in. Otherwise a brief flash of an unstyled
"[Collapse]" button would be visible. This is achieved by making it it's
own module, and loading it as a dependency.

* The "toolbaritem" is not loaded on diff pages. That's why diff showed
an unstyled "[Collapse]". This is fixed now.

Bug: T182767
Change-Id: I6713bdf4c4994475d80c3a7a55cf6550d17b1968
---
M view/resources/jquery/wikibase/resources.php
R view/resources/jquery/wikibase/themes/default/images/collapse.png
R view/resources/jquery/wikibase/themes/default/images/collapse.svg
R view/resources/jquery/wikibase/themes/default/images/expand.png
R view/resources/jquery/wikibase/themes/default/images/expand.svg
A 
view/resources/jquery/wikibase/themes/default/jquery.wikibase.sitelinkgroupview.mw-collapsible.css
M 
view/resources/jquery/wikibase/toolbar/themes/default/jquery.wikibase.toolbaritem.css
7 files changed, 37 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/84/400684/1

diff --git a/view/resources/jquery/wikibase/resources.php 
b/view/resources/jquery/wikibase/resources.php
index cbb7caf..2854688 100644
--- a/view/resources/jquery/wikibase/resources.php
+++ b/view/resources/jquery/wikibase/resources.php
@@ -323,10 +323,10 @@

'themes/default/jquery.wikibase.sitelinkgroupview.css',
],
'dependencies' => [
-   'jquery.makeCollapsible',
'jquery.sticknode',
'jquery.ui.EditableTemplatedWidget',
'jquery.util.EventSingletonManager',
+   
'jquery.wikibase.sitelinkgroupview.mw-collapsible.styles',
'mediawiki.jqueryMsg', // for {{plural}} and 
{{gender}} support in messages
'wikibase.buildErrorOutput',
'wikibase.sites',
@@ -336,6 +336,12 @@
],
],
 
+   'jquery.wikibase.sitelinkgroupview.mw-collapsible.styles' => 
$moduleTemplate + [
+   'styles' => [
+   
'themes/default/jquery.wikibase.sitelinkgroupview.mw-collapsible.css',
+   ],
+   ],
+
'jquery.wikibase.sitelinklistview' => $moduleTemplate + [
'scripts' => [
'jquery.wikibase.sitelinklistview.js',
diff --git 
a/view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/collapse.png
 b/view/resources/jquery/wikibase/themes/default/images/collapse.png
similarity index 100%
rename from 
view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/collapse.png
rename to view/resources/jquery/wikibase/themes/default/images/collapse.png
Binary files differ
diff --git 
a/view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/collapse.svg
 b/view/resources/jquery/wikibase/themes/default/images/collapse.svg
similarity index 100%
rename from 
view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/collapse.svg
rename to view/resources/jquery/wikibase/themes/default/images/collapse.svg
diff --git 
a/view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/expand.png
 b/view/resources/jquery/wikibase/themes/default/images/expand.png
similarity index 100%
rename from 
view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/expand.png
rename to view/resources/jquery/wikibase/themes/default/images/expand.png
Binary files differ
diff --git 
a/view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/expand.svg
 b/view/resources/jquery/wikibase/themes/default/images/expand.svg
similarity index 100%
rename from 
view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/expand.svg
rename to view/resources/jquery/wikibase/themes/default/images/expand.svg
diff --git 
a/view/resources/jquery/wikibase/themes/default/jquery.wikibase.sitelinkgroupview.mw-collapsible.css
 
b/view/resources/jquery/wikibase/themes/default/jquery.wikibase.sitelinkgroupview.mw-collapsible.css
new file mode 100644
index 000..0165e1a
--- /dev/null
+++ 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Remove leading backslashes from "use \…" tags

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400607 )

Change subject: Remove leading backslashes from "use \…" tags
..

Remove leading backslashes from "use \…" tags

Change-Id: I92a1cbd053c7d8eddf3b4b6d291c7b346e7c377f
---
M includes/Query/ContentModelFeature.php
M includes/Query/FileNumericFeature.php
M includes/Query/FileTypeFeature.php
M includes/SiteMatrixInterwikiResolver.php
4 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/07/400607/1

diff --git a/includes/Query/ContentModelFeature.php 
b/includes/Query/ContentModelFeature.php
index ea09202..1dc9288 100644
--- a/includes/Query/ContentModelFeature.php
+++ b/includes/Query/ContentModelFeature.php
@@ -3,7 +3,7 @@
 namespace CirrusSearch\Query;
 
 use CirrusSearch\Search\SearchContext;
-use \Elastica\Query;
+use Elastica\Query;
 
 /**
  * Content model feature:
diff --git a/includes/Query/FileNumericFeature.php 
b/includes/Query/FileNumericFeature.php
index 4b70d58..901c482 100644
--- a/includes/Query/FileNumericFeature.php
+++ b/includes/Query/FileNumericFeature.php
@@ -3,7 +3,7 @@
 namespace CirrusSearch\Query;
 
 use CirrusSearch\Search\SearchContext;
-use \Elastica\Query;
+use Elastica\Query;
 
 /**
  * File features:
diff --git a/includes/Query/FileTypeFeature.php 
b/includes/Query/FileTypeFeature.php
index 703dded..923912a 100644
--- a/includes/Query/FileTypeFeature.php
+++ b/includes/Query/FileTypeFeature.php
@@ -3,7 +3,7 @@
 namespace CirrusSearch\Query;
 
 use CirrusSearch\Search\SearchContext;
-use \Elastica\Query;
+use Elastica\Query;
 
 /**
  * File type features:
diff --git a/includes/SiteMatrixInterwikiResolver.php 
b/includes/SiteMatrixInterwikiResolver.php
index 0328b35..4508c87 100644
--- a/includes/SiteMatrixInterwikiResolver.php
+++ b/includes/SiteMatrixInterwikiResolver.php
@@ -2,15 +2,15 @@
 
 namespace CirrusSearch;
 
-use \ObjectCache;
-use \SiteMatrix;
 use MediaWiki\MediaWikiServices;
+use ObjectCache;
+use SiteMatrix;
 
 /**
  * InterwikiResolver suited for WMF context and uses SiteMatrix.
  */
-
 class SiteMatrixInterwikiResolver extends BaseInterwikiResolver {
+
const MATRIX_CACHE_TTL = 600;
 
private $cache;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92a1cbd053c7d8eddf3b4b6d291c7b346e7c377f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Improve 1-letter variable names in MutableContext and implem...

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400606 )

Change subject: Improve 1-letter variable names in MutableContext and 
implementations
..

Improve 1-letter variable names in MutableContext and implementations

I'm also removing obsolete short comments that don't add anything to
whats already obvious from the method header. For example, I really don't
need a comment to understand that a method that's called "setUser" and
accepts a parameter named "$user" of type "User" is meant to "set the
User object". I mean, how more obvious can it be? ;-)

Change-Id: Ib079108457a5aa2a6896e95837542ab93b465144
---
M includes/context/ContextSource.php
M includes/context/DerivativeContext.php
M includes/context/IContextSource.php
M includes/context/MutableContext.php
M includes/context/RequestContext.php
5 files changed, 74 insertions(+), 192 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/06/400606/1

diff --git a/includes/context/ContextSource.php 
b/includes/context/ContextSource.php
index 6530550..03fb9e2 100644
--- a/includes/context/ContextSource.php
+++ b/includes/context/ContextSource.php
@@ -49,8 +49,6 @@
}
 
/**
-* Set the IContextSource object
-*
 * @since 1.18
 * @param IContextSource $context
 */
@@ -59,8 +57,6 @@
}
 
/**
-* Get the Config object
-*
 * @since 1.23
 * @return Config
 */
@@ -69,8 +65,6 @@
}
 
/**
-* Get the WebRequest object
-*
 * @since 1.18
 * @return WebRequest
 */
@@ -79,8 +73,6 @@
}
 
/**
-* Get the Title object
-*
 * @since 1.18
 * @return Title|null
 */
@@ -114,8 +106,6 @@
}
 
/**
-* Get the OutputPage object
-*
 * @since 1.18
 * @return OutputPage
 */
@@ -124,8 +114,6 @@
}
 
/**
-* Get the User object
-*
 * @since 1.18
 * @return User
 */
@@ -134,8 +122,6 @@
}
 
/**
-* Get the Language object
-*
 * @since 1.19
 * @return Language
 */
@@ -144,8 +130,6 @@
}
 
/**
-* Get the Skin object
-*
 * @since 1.18
 * @return Skin
 */
@@ -154,8 +138,6 @@
}
 
/**
-* Get the Timing object
-*
 * @since 1.27
 * @return Timing
 */
@@ -164,8 +146,6 @@
}
 
/**
-* Get the Stats object
-*
 * @deprecated since 1.27 use a StatsdDataFactory from 
MediaWikiServices (preferably injected)
 *
 * @since 1.25
diff --git a/includes/context/DerivativeContext.php 
b/includes/context/DerivativeContext.php
index 82b97ec..f7a1815 100644
--- a/includes/context/DerivativeContext.php
+++ b/includes/context/DerivativeContext.php
@@ -81,17 +81,13 @@
}
 
/**
-* Set the SiteConfiguration object
-*
-* @param Config $s
+* @param Config $config
 */
-   public function setConfig( Config $s ) {
-   $this->config = $s;
+   public function setConfig( Config $config ) {
+   $this->config = $config;
}
 
/**
-* Get the Config object
-*
 * @return Config
 */
public function getConfig() {
@@ -103,8 +99,6 @@
}
 
/**
-* Get the stats object
-*
 * @deprecated since 1.27 use a StatsdDataFactory from 
MediaWikiServices (preferably injected)
 *
 * @return IBufferingStatsdDataFactory
@@ -114,8 +108,6 @@
}
 
/**
-* Get the timing object
-*
 * @return Timing
 */
public function getTiming() {
@@ -127,17 +119,13 @@
}
 
/**
-* Set the WebRequest object
-*
-* @param WebRequest $r
+* @param WebRequest $request
 */
-   public function setRequest( WebRequest $r ) {
-   $this->request = $r;
+   public function setRequest( WebRequest $request ) {
+   $this->request = $request;
}
 
/**
-* Get the WebRequest object
-*
 * @return WebRequest
 */
public function getRequest() {
@@ -149,17 +137,13 @@
}
 
/**
-* Set the Title object
-*
-* @param Title $t
+* @param Title $title
 */
-   public function setTitle( Title $t ) {
-   $this->title = $t;
+   public function setTitle( Title $title ) {
+   $this->title = $title;
}
 
/**
-* Get the Title object
-*
 * @return Title|null
 */
public function getTitle() {
@@ -189,13 +173,11 @@

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Start using RevisionRecord in favor of Revision in trivial c...

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400588 )

Change subject: Start using RevisionRecord in favor of Revision in trivial cases
..

Start using RevisionRecord in favor of Revision in trivial cases

This patch picks a few very, very low hanging fruits to replace some of
the deprecation warnings related to the now deprecated Revision class.

Change-Id: I3c68ccd1117303cfac3d29f0f092284be457e12c
---
M lib/includes/Store/RedirectRevision.php
M repo/Wikibase.hooks.php
M repo/includes/Api/ResultBuilder.php
M repo/includes/Diff/EntityContentDiffView.php
M repo/tests/phpunit/includes/Api/SetClaimValueTest.php
5 files changed, 20 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/88/400588/1

diff --git a/lib/includes/Store/RedirectRevision.php 
b/lib/includes/Store/RedirectRevision.php
index 41dae74..63d8650 100644
--- a/lib/includes/Store/RedirectRevision.php
+++ b/lib/includes/Store/RedirectRevision.php
@@ -57,7 +57,7 @@
}
 
/**
-* @see Revision::getId
+* @see RevisionRecord::getId
 *
 * @return int
 */
@@ -66,7 +66,7 @@
}
 
/**
-* @see Revision::getTimestamp
+* @see RevisionRecord::getTimestamp
 *
 * @return string in MediaWiki format or an empty string
 */
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index ee2304b..79f7ddd 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -16,6 +16,7 @@
 use IContextSource;
 use LogEntry;
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\RevisionRecord;
 use MWException;
 use MWExceptionHandler;
 use OutputPage;
@@ -200,7 +201,10 @@
$entityContentFactory = 
WikibaseRepo::getDefaultInstance()->getEntityContentFactory();
 
if ( $entityContentFactory->isEntityContentModel( 
$wikiPage->getContent()->getModel() ) ) {
-   self::notifyEntityStoreWatcherOnUpdate( $revision );
+   self::notifyEntityStoreWatcherOnUpdate(
+   $revision->getContent(),
+   $revision->getRevisionRecord()
+   );
 
$notifier = 
WikibaseRepo::getDefaultInstance()->getChangeNotifier();
$parentId = $revision->getParentId();
@@ -222,9 +226,10 @@
}
}
 
-   private static function notifyEntityStoreWatcherOnUpdate( Revision 
$revision ) {
-   /** @var EntityContent $content */
-   $content = $revision->getContent();
+   private static function notifyEntityStoreWatcherOnUpdate(
+   EntityContent $content,
+   RevisionRecord $revision
+   ) {
$watcher = 
WikibaseRepo::getDefaultInstance()->getEntityStoreWatcher();
 
// Notify storage/lookup services that the entity was updated. 
Needed to track page-level changes.
@@ -410,7 +415,7 @@
if ( $entityContentFactory->isEntityContentModel( 
$history->getTitle()->getContentModel() )
&& $wikiPage->getLatest() !== $rev->getId()
&& $rev->getTitle()->quickUserCan( 'edit', 
$history->getUser() )
-   && !$rev->isDeleted( Revision::DELETED_TEXT )
+   && !$rev->isDeleted( RevisionRecord::DELETED_TEXT )
) {
$linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
$link = $linkRenderer->makeKnownLink(
@@ -458,7 +463,7 @@
: 
$skinTemplate->getRevisionId();
 
$rev = Revision::newFromId( $revid );
-   if ( !$rev || $rev->isDeleted( 
Revision::DELETED_TEXT ) ) {
+   if ( !$rev || $rev->isDeleted( 
RevisionRecord::DELETED_TEXT ) ) {
return;
}
 
diff --git a/repo/includes/Api/ResultBuilder.php 
b/repo/includes/Api/ResultBuilder.php
index 9f5e86e..cf01e2f 100644
--- a/repo/includes/Api/ResultBuilder.php
+++ b/repo/includes/Api/ResultBuilder.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Repo\Api;
 
 use ApiResult;
+use MediaWiki\Storage\RevisionRecord;
 use Revision;
 use Serializers\Serializer;
 use SiteLookup;
@@ -1078,7 +1079,7 @@
}
 
private function getRevisionId( $revision ) {
-   if ( $revision instanceof Revision ) {
+   if ( $revision instanceof Revision || $revision instanceof 
RevisionRecord ) {
$revisionId = $revision->getId();
} elseif ( $revision instanceof EntityRevision ) {
$revisionId = 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Improve (weak and strict) type hints invarious places

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400587 )

Change subject: Improve (weak and strict) type hints invarious places
..

Improve (weak and strict) type hints invarious places

Change-Id: I3a42ec1547fae971d7b495c99dd144739d8521ab
---
M includes/OutputPage.php
M includes/Title.php
M includes/cache/CacheDependency.php
M includes/content/Content.php
M includes/context/MutableContext.php
M includes/context/RequestContext.php
M includes/installer/DatabaseUpdater.php
M includes/search/SearchExactMatchRescorer.php
M includes/specials/pagers/ContribsPager.php
9 files changed, 16 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/400587/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 1c2c29d..a2d445f 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -366,8 +366,8 @@
 * Add a new "" tag
 * To add an http-equiv meta tag, precede the name with "http:"
 *
-* @param string $name Tag name
-* @param string $val Tag value
+* @param string $name Name of the meta tag
+* @param string $val Value of the meta tag
 */
function addMeta( $name, $val ) {
array_push( $this->mMetatags, [ $name, $val ] );
diff --git a/includes/Title.php b/includes/Title.php
index b23bd5a..3de85e1 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -4644,7 +4644,7 @@
/**
 * Get the last touched timestamp
 *
-* @param IDatabase $db Optional db
+* @param IDatabase|null $db
 * @return string|false Last-touched timestamp
 */
public function getTouched( $db = null ) {
diff --git a/includes/cache/CacheDependency.php 
b/includes/cache/CacheDependency.php
index a59ba97..dd4c49e 100644
--- a/includes/cache/CacheDependency.php
+++ b/includes/cache/CacheDependency.php
@@ -34,7 +34,6 @@
private $deps;
 
/**
-* Create an instance.
 * @param mixed $value The user-supplied value
 * @param CacheDependency|CacheDependency[] $deps A dependency or 
dependency
 *   array. All dependencies must be objects implementing 
CacheDependency.
diff --git a/includes/content/Content.php b/includes/content/Content.php
index 6a0a63b..3e58782 100644
--- a/includes/content/Content.php
+++ b/includes/content/Content.php
@@ -483,11 +483,11 @@
 * @since 1.21
 *
 * @param WikiPage $page The deleted page
-* @param ParserOutput $parserOutput Optional parser output object
+* @param ParserOutput|null $parserOutput Optional parser output object
 *for efficient access to meta-information about the content object.
 *Provide if you have one handy.
 *
-* @return DataUpdate[] A list of DataUpdate instances that will clean 
up the
+* @return DeferrableUpdate[] A list of DeferrableUpdate instances that 
will clean up the
 *database after deletion.
 */
public function getDeletionUpdates( WikiPage $page,
diff --git a/includes/context/MutableContext.php 
b/includes/context/MutableContext.php
index 6358f11..189b346 100644
--- a/includes/context/MutableContext.php
+++ b/includes/context/MutableContext.php
@@ -26,9 +26,9 @@
/**
 * Set the Config object
 *
-* @param Config $c
+* @param Config $config
 */
-   public function setConfig( Config $c );
+   public function setConfig( Config $config );
 
/**
 * Set the WebRequest object
diff --git a/includes/context/RequestContext.php 
b/includes/context/RequestContext.php
index c2d0de1..cf5c939 100644
--- a/includes/context/RequestContext.php
+++ b/includes/context/RequestContext.php
@@ -81,17 +81,13 @@
private static $instance = null;
 
/**
-* Set the Config object
-*
-* @param Config $c
+* @param Config $config
 */
-   public function setConfig( Config $c ) {
-   $this->config = $c;
+   public function setConfig( Config $config ) {
+   $this->config = $config;
}
 
/**
-* Get the Config object
-*
 * @return Config
 */
public function getConfig() {
diff --git a/includes/installer/DatabaseUpdater.php 
b/includes/installer/DatabaseUpdater.php
index 54ff712..242f148 100644
--- a/includes/installer/DatabaseUpdater.php
+++ b/includes/installer/DatabaseUpdater.php
@@ -179,12 +179,12 @@
/**
 * @param Database $db
 * @param bool $shared
-* @param Maintenance $maintenance
+* @param Maintenance|null $maintenance
 *
 * @throws MWException
 * @return DatabaseUpdater
 */
-   public static function newForDB( Database $db, $shared = false, 
$maintenance = 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove leading backslashes from "use \…" tags

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400586 )

Change subject: Remove leading backslashes from "use \…" tags
..

Remove leading backslashes from "use \…" tags

Change-Id: I494b029de089a07e3b946ee78293a12d5036f63e
---
M includes/Storage/RevisionLookup.php
M includes/Storage/RevisionStore.php
M includes/filebackend/FileBackendGroup.php
M includes/interwiki/ClassicInterwikiLookup.php
M includes/jobqueue/jobs/DeleteLinksJob.php
M includes/objectcache/SqlBagOStuff.php
M includes/page/WikiPage.php
M includes/password/PasswordPolicyChecks.php
M includes/tidy/Balancer.php
M includes/utils/BatchRowWriter.php
M languages/data/CrhExceptions.php
M maintenance/cdb.php
12 files changed, 29 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/400586/1

diff --git a/includes/Storage/RevisionLookup.php 
b/includes/Storage/RevisionLookup.php
index 5cd157b..afe0f81 100644
--- a/includes/Storage/RevisionLookup.php
+++ b/includes/Storage/RevisionLookup.php
@@ -22,7 +22,7 @@
 
 namespace MediaWiki\Storage;
 
-use \IDBAccessObject;
+use IDBAccessObject;
 use MediaWiki\Linker\LinkTarget;
 use Title;
 
diff --git a/includes/Storage/RevisionStore.php 
b/includes/Storage/RevisionStore.php
index 44dab13..3c9c432 100644
--- a/includes/Storage/RevisionStore.php
+++ b/includes/Storage/RevisionStore.php
@@ -32,7 +32,7 @@
 use ContentHandler;
 use DBAccessObjectUtils;
 use Hooks;
-use \IDBAccessObject;
+use IDBAccessObject;
 use InvalidArgumentException;
 use IP;
 use LogicException;
diff --git a/includes/filebackend/FileBackendGroup.php 
b/includes/filebackend/FileBackendGroup.php
index 0b61979..8182d62 100644
--- a/includes/filebackend/FileBackendGroup.php
+++ b/includes/filebackend/FileBackendGroup.php
@@ -20,7 +20,8 @@
  * @file
  * @ingroup FileBackend
  */
-use \MediaWiki\Logger\LoggerFactory;
+
+use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
 
 /**
diff --git a/includes/interwiki/ClassicInterwikiLookup.php 
b/includes/interwiki/ClassicInterwikiLookup.php
index d9c0424..d5103da 100644
--- a/includes/interwiki/ClassicInterwikiLookup.php
+++ b/includes/interwiki/ClassicInterwikiLookup.php
@@ -1,6 +1,4 @@
 https://gerrit.wikimedia.org/r/400586
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I494b029de089a07e3b946ee78293a12d5036f63e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove very, very old disabled test cases and todos

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400585 )

Change subject: Remove very, very old disabled test cases and todos
..

Remove very, very old disabled test cases and todos

Some of this is from 2011.

Change-Id: I3cf78e6b451af92063746af87c25c1d352ce94da
---
M tests/phpunit/includes/HtmlTest.php
M tests/phpunit/includes/MWNamespaceTest.php
M tests/phpunit/includes/content/ContentHandlerTest.php
M tests/phpunit/includes/content/WikitextContentHandlerTest.php
M tests/phpunit/includes/media/PNGMetadataExtractorTest.php
5 files changed, 1 insertion(+), 109 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/400585/1

diff --git a/tests/phpunit/includes/HtmlTest.php 
b/tests/phpunit/includes/HtmlTest.php
index 7e32770..6695fce 100644
--- a/tests/phpunit/includes/HtmlTest.php
+++ b/tests/phpunit/includes/HtmlTest.php
@@ -1,5 +1,4 @@
 assertFalse( MWNamespace::isMovable( NS_SPECIAL ) );
-   # @todo FIXME: Write more tests!!
}
 
/**
@@ -154,18 +148,6 @@
}
 
/**
-* @todo Implement testExists().
-*/
-   /*
-   public function testExists() {
-   // Remove the following lines when you implement this test.
-   $this->markTestIncomplete(
-   'This test has not been implemented yet. Rely on 
$wgCanonicalNamespaces.'
-   );
-   }
-   */
-
-   /**
 * Test MWNamespace::equals
 * Note if we add a namespace registration system with keys like 'MAIN'
 * we should add tests here for equivilance on things like 'MAIN' == 0
@@ -214,52 +196,6 @@
"NS_SPECIAL and NS_MEDIA are different subject 
namespaces"
);
}
-
-   /**
-* @todo Implement testGetCanonicalNamespaces().
-*/
-   /*
-   public function testGetCanonicalNamespaces() {
-   // Remove the following lines when you implement this test.
-   $this->markTestIncomplete(
-   'This test has not been implemented yet. Rely on 
$wgCanonicalNamespaces.'
-   );
-   }
-   */
-   /**
-* @todo Implement testGetCanonicalName().
-*/
-   /*
-   public function testGetCanonicalName() {
-   // Remove the following lines when you implement this 
test.
-   $this->markTestIncomplete(
-   'This test has not been implemented yet. Rely 
on $wgCanonicalNamespaces.'
-   );
-   }
-   */
-   /**
-* @todo Implement testGetCanonicalIndex().
-*/
-   /*
-   public function testGetCanonicalIndex() {
-   // Remove the following lines when you implement this test.
-   $this->markTestIncomplete(
-   'This test has not been implemented yet. Rely on 
$wgCanonicalNamespaces.'
-   );
-   }
-   */
-
-   /**
-* @todo Implement testGetValidNamespaces().
-*/
-   /*
-   public function testGetValidNamespaces() {
-   // Remove the following lines when you implement this test.
-   $this->markTestIncomplete(
-   'This test has not been implemented yet. Rely on 
$wgCanonicalNamespaces.'
-   );
-   }
-   */
 
public function provideHasTalkNamespace() {
return [
diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php 
b/tests/phpunit/includes/content/ContentHandlerTest.php
index 1462c36..f4802fe 100644
--- a/tests/phpunit/includes/content/ContentHandlerTest.php
+++ b/tests/phpunit/includes/content/ContentHandlerTest.php
@@ -248,10 +248,6 @@
$this->assertNull( $text );
}
 
-   /*
-   public static function makeContent( $text, Title $title, $modelId = 
null, $format = null ) {}
-   */
-
public static function dataMakeContent() {
return [
[ 'hallo', 'Help:Test', null, null, 
CONTENT_MODEL_WIKITEXT, 'hallo', false ],
@@ -370,11 +366,6 @@
$this->assertSame( $tag, 'mw-contentmodelchange' );
}
 
-   /*
-   public function testSupportsSections() {
-   $this->markTestIncomplete( "not yet implemented" );
-   }
-   */
 
/**
 * @covers ContentHandler::supportsCategories
diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php 
b/tests/phpunit/includes/content/WikitextContentHandlerTest.php
index 02f82f4..d90b347 100644
--- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php
+++ b/tests/phpunit/includes/content/WikitextContentHandlerTest.php
@@ -335,22 +335,6 @@
$this->assertSame( $expected, $tag );
}
 
-   /**
-* @todo 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Simplify documentation headers of includes/widgets/…Widget.p...

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400584 )

Change subject: Simplify documentation headers of includes/widgets/…Widget.php 
files
..

Simplify documentation headers of includes/widgets/…Widget.php files

Most notably: The documentation header repeats the file name. This
appears to be fully automatically generated, but does not add helpful
information.

Change-Id: I9edf15dd25ef6cc52fe931fffde69f0bd9042474
---
M includes/widget/ComplexNamespaceInputWidget.php
M includes/widget/ComplexTitleInputWidget.php
M includes/widget/DateInputWidget.php
M includes/widget/DateTimeInputWidget.php
M includes/widget/NamespaceInputWidget.php
M includes/widget/SearchInputWidget.php
M includes/widget/SelectWithInputWidget.php
M includes/widget/TitleInputWidget.php
M includes/widget/UserInputWidget.php
M includes/widget/UsersMultiselectWidget.php
10 files changed, 31 insertions(+), 63 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/400584/1

diff --git a/includes/widget/ComplexNamespaceInputWidget.php 
b/includes/widget/ComplexNamespaceInputWidget.php
index d3ada03..e76ecd5 100644
--- a/includes/widget/ComplexNamespaceInputWidget.php
+++ b/includes/widget/ComplexNamespaceInputWidget.php
@@ -1,15 +1,12 @@
 https://gerrit.wikimedia.org/r/400584
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9edf15dd25ef6cc52fe931fffde69f0bd9042474
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove self-explaining "section heading" comments from classes

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400583 )

Change subject: Remove self-explaining "section heading" comments from classes
..

Remove self-explaining "section heading" comments from classes

I can see that "parent::__construct" literally calls the parent
constructor. I can see that stuff preceeded by the keyword "protected"
is protected. I really (really) don't need comments explaining such.

Change-Id: I7458e714976a6acd3ba6a7c93fdc27d03903df83
---
M includes/Linker.php
M includes/actions/WatchAction.php
M includes/context/RequestContext.php
M includes/htmlform/HTMLFormElement.php
M includes/libs/CSSMin.php
M includes/libs/JavaScriptMinifier.php
M includes/resourceloader/ResourceLoader.php
M includes/resourceloader/ResourceLoaderFileModule.php
M includes/resourceloader/ResourceLoaderFilePath.php
M includes/resourceloader/ResourceLoaderModule.php
M includes/resourceloader/ResourceLoaderUserTokensModule.php
M includes/specials/pagers/ProtectedPagesPager.php
M includes/widget/ComplexNamespaceInputWidget.php
M includes/widget/ComplexTitleInputWidget.php
M includes/widget/DateInputWidget.php
M includes/widget/DateTimeInputWidget.php
M includes/widget/NamespaceInputWidget.php
M includes/widget/SearchInputWidget.php
M includes/widget/SelectWithInputWidget.php
M includes/widget/TitleInputWidget.php
M includes/widget/UserInputWidget.php
21 files changed, 4 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/83/400583/1

diff --git a/includes/Linker.php b/includes/Linker.php
index 84e3103..c0255ac 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -2124,8 +2124,6 @@
return Xml::tags( 'span', [ 'class' => 'mw-revdelundel-link' ], 
$htmlParentheses );
}
 
-   /* Deprecated methods */
-
/**
 * Returns the attributes for the tooltip and access key.
 *
diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php
index e12a727..528e0e2 100644
--- a/includes/actions/WatchAction.php
+++ b/includes/actions/WatchAction.php
@@ -80,8 +80,6 @@
$this->getOutput()->addWikiMsg( $msgKey, 
$this->getTitle()->getPrefixedText() );
}
 
-   /* Static utility methods */
-
/**
 * Watch or unwatch a page
 * @since 1.22
diff --git a/includes/context/RequestContext.php 
b/includes/context/RequestContext.php
index c2d0de1..652f068 100644
--- a/includes/context/RequestContext.php
+++ b/includes/context/RequestContext.php
@@ -441,8 +441,6 @@
return $this->skin;
}
 
-   /** Helpful methods **/
-
/**
 * Get a Message object with context set
 * Parameters are the same as wfMessage()
@@ -457,8 +455,6 @@
 
return call_user_func_array( 'wfMessage', $args )->setContext( 
$this );
}
-
-   /** Static methods **/
 
/**
 * Get the RequestContext object associated with the main request
diff --git a/includes/htmlform/HTMLFormElement.php 
b/includes/htmlform/HTMLFormElement.php
index 10db90c..66d6143 100644
--- a/includes/htmlform/HTMLFormElement.php
+++ b/includes/htmlform/HTMLFormElement.php
@@ -38,8 +38,8 @@
use HTMLFormElement;
 
public function __construct( $fieldWidget, array $config = [] ) {
-   // Parent constructor
parent::__construct( $fieldWidget, $config );
+
// Traits
$this->initializeHTMLFormElement( $config );
}
@@ -53,8 +53,8 @@
use HTMLFormElement;
 
public function __construct( $fieldWidget, $buttonWidget = false, array 
$config = [] ) {
-   // Parent constructor
parent::__construct( $fieldWidget, $buttonWidget, $config );
+
// Traits
$this->initializeHTMLFormElement( $config );
}
diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php
index ee88d0d..a9cbba2 100644
--- a/includes/libs/CSSMin.php
+++ b/includes/libs/CSSMin.php
@@ -29,8 +29,6 @@
  */
 class CSSMin {
 
-   /* Constants */
-
/** @var string Strip marker for comments. **/
const PLACEHOLDER = "\x7fPLACEHOLDER\x7f";
 
@@ -41,8 +39,6 @@
 
const EMBED_REGEX = '\/\*\s*\@embed\s*\*\/';
const COMMENT_REGEX = '\/\*.*?\*\/';
-
-   /* Protected Static Members */
 
/** @var array List of common image files extensions and MIME-types */
protected static $mimeTypes = [
@@ -56,8 +52,6 @@
'xbm' => 'image/x-xbitmap',
'svg' => 'image/svg+xml',
];
-
-   /* Static Methods */
 
/**
 * Get a list of local files referenced in a stylesheet (includes 
non-existent files).
diff --git a/includes/libs/JavaScriptMinifier.php 
b/includes/libs/JavaScriptMinifier.php
index bbba33a..ea4755e 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove @param comments that literally repeat what the code says

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400582 )

Change subject: Remove @param comments that literally repeat what the code says
..

Remove @param comments that literally repeat what the code says

These comments do not add anything. I argue they are worse than having
no comments, because I have to read them first to understand they
actually don't explain anything. Removing them makes room for actual
improvements in the future (if needed).

Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
---
M includes/EditPage.php
M includes/FeedUtils.php
M includes/GlobalFunctions.php
M includes/Linker.php
M includes/OutputPage.php
M includes/Preferences.php
M includes/WebRequest.php
M includes/actions/HistoryAction.php
M includes/actions/InfoAction.php
M includes/api/ApiBase.php
M includes/api/ApiPageSet.php
M includes/auth/LegacyHookPreAuthenticationProvider.php
M includes/cache/CacheDependency.php
M includes/cache/GenderCache.php
M includes/cache/MessageCache.php
M includes/changes/ChangesListBooleanFilterGroup.php
M includes/changes/ChangesListFilter.php
M includes/changes/ChangesListFilterGroup.php
M includes/changes/ChangesListStringOptionsFilterGroup.php
M includes/changetags/ChangeTags.php
M includes/content/AbstractContent.php
M includes/content/JsonContent.php
M includes/content/TextContent.php
M includes/exception/LocalizedException.php
M includes/gallery/ImageGalleryBase.php
M includes/installer/PostgresInstaller.php
M includes/libs/IEUrlExtension.php
M includes/libs/StatusValue.php
M includes/libs/mime/XmlTypeCheck.php
M includes/libs/objectcache/MemcachedClient.php
M includes/libs/rdbms/TransactionProfiler.php
M includes/logging/LogEventsList.php
M includes/logging/LogPage.php
M includes/media/BitmapMetadataHandler.php
M includes/media/IPTC.php
M includes/media/MediaHandler.php
M includes/media/WebP.php
M includes/media/XCF.php
M includes/parser/Parser.php
M includes/parser/StripState.php
M includes/resourceloader/ResourceLoaderModule.php
M includes/revisiondelete/RevDelItem.php
M includes/search/SearchExactMatchRescorer.php
M includes/session/SessionBackend.php
M includes/specialpage/ChangesListSpecialPage.php
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialUploadStash.php
M includes/specials/pagers/UsersPager.php
M includes/user/User.php
M maintenance/generateSitemap.php
M maintenance/importImages.php
M maintenance/sql.php
M tests/phpunit/includes/auth/LegacyHookPreAuthenticationProviderTest.php
M tests/phpunit/includes/collation/CollationTest.php
M tests/phpunit/includes/session/TestBagOStuff.php
M tests/phpunit/includes/session/TestUtils.php
M tests/phpunit/mocks/content/DummyContentForTesting.php
M tests/phpunit/mocks/content/DummyNonTextContent.php
58 files changed, 90 insertions(+), 94 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/82/400582/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index bcaab3a..6d64388 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -780,7 +780,7 @@
 
/**
 * Display a read-only View Source page
-* @param Content $content content object
+* @param Content $content
 * @param string $errorMessage additional wikitext error message to 
display
 */
protected function displayViewSourcePage( Content $content, 
$errorMessage = '' ) {
diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php
index 6c343ab..6108ca1 100644
--- a/includes/FeedUtils.php
+++ b/includes/FeedUtils.php
@@ -97,7 +97,7 @@
/**
 * Really format a diff for the newsfeed
 *
-* @param Title $title Title object
+* @param Title $title
 * @param int $oldid Old revision's id
 * @param int $newid New revision's id
 * @param int $timestamp New revision's timestamp
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 1a33b76..7c5656d 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1011,7 +1011,7 @@
 
 /**
  * Check whether a given URL has a domain that occurs in a given set of domains
- * @param string $url URL
+ * @param string $url
  * @param array $domains Array of domains (strings)
  * @return bool True if the host part of $url ends in one of the strings in 
$domains
  */
diff --git a/includes/Linker.php b/includes/Linker.php
index 84e3103..bda40af 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -1023,7 +1023,7 @@
 
/**
 * @since 1.16.3
-* @param int $userId Userid
+* @param int $userId
 * @param string $userText User name in database.
 * @return string HTML fragment with block link
 */
@@ -1037,7 +1037,7 @@
}
 
/**
-* @param int $userId Userid
+* @param int $userId
 * @param string $userText User name in database.

[MediaWiki-commits] [Gerrit] mediawiki...Cite[master]: Remove some obscure comments

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400581 )

Change subject: Remove some obscure comments
..

Remove some obscure comments

A good bunch of these comments literally repeats what the code already
says.

Change-Id: I9c128f748971bf20a61a85ed57d3261d27c465f0
---
M includes/Cite.php
M includes/CiteCSSFileModule.php
M includes/CiteDataModule.php
M includes/CiteHooks.php
4 files changed, 18 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite 
refs/changes/81/400581/1

diff --git a/includes/Cite.php b/includes/Cite.php
index 02b93c5..3215137 100644
--- a/includes/Cite.php
+++ b/includes/Cite.php
@@ -392,7 +392,6 @@
 *  "group" : Group to which it belongs. Needs to be passed to 
 too.
 *  "follow" : If the current reference is the continuation of another, 
key of that reference.
 *
-*
 * @param string[] $argv The argument vector
 * @return mixed false on invalid input, a string on valid
 *   input and null on no input
@@ -923,8 +922,8 @@
 *
 * @static
 *
-* @param int $base The base
-* @param int $offset The offset
+* @param int $base
+* @param int $offset
 * @param int $max Maximum value expected.
 * @return string
 */
@@ -943,7 +942,7 @@
 * 'b', 'c', ...]. Return an error if the offset > the # of
 * array items
 *
-* @param int $offset The offset
+* @param int $offset
 *
 * @return string
 */
@@ -965,7 +964,7 @@
 * [ 'a', 'b', 'c', ...].
 * Return an error if the offset > the # of array items
 *
-* @param int $offset The offset
+* @param int $offset
 * @param string $group The group name
 * @param string $label The text to use if there's no message for them.
 *
@@ -996,7 +995,7 @@
 *
 * @static
 *
-* @param string $key The key
+* @param string $key
 * @param int $num The number of the key
 * @return string A key for use in wikitext
 */
@@ -1018,7 +1017,7 @@
 *
 * @static
 *
-* @param string $key The key
+* @param string $key
 * @return string A key for use in wikitext
 */
public static function getReferencesKey( $key ) {
diff --git a/includes/CiteCSSFileModule.php b/includes/CiteCSSFileModule.php
index ef945e2..88215b4 100644
--- a/includes/CiteCSSFileModule.php
+++ b/includes/CiteCSSFileModule.php
@@ -1,14 +1,12 @@
 makeConfig( 
'cite' );
$data['citeresponsivereferences'] = $config->get( 
'CiteResponsiveReferences' );
}
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c128f748971bf20a61a85ed57d3261d27c465f0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Cleanup and unify class level PHPDoc blocks

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400580 )

Change subject: Cleanup and unify class level PHPDoc blocks
..

Cleanup and unify class level PHPDoc blocks

This unifies certain minor details of the coding style across this
code base. This patch is pretty much exclusively about comments and
should not have any effect on production.

Change-Id: Ic96e60b85503a808f9c55a1efc663c95d413b1fc
---
M NewsletterHooks.php
M includes/Echo/BaseNewsletterPresentationModel.php
M includes/Echo/EchoNewsletterPresentationModel.php
M includes/Echo/EchoNewsletterPublisherAddedPresentationModel.php
M includes/Echo/EchoNewsletterSubscribedPresentationModel.php
M includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php
M includes/Echo/EchoNewsletterUserLocator.php
M includes/Newsletter.php
M includes/NewsletterValidator.php
M includes/api/ApiNewsletterSubscribe.php
M includes/content/NewsletterContent.php
M includes/content/NewsletterContentHandler.php
M includes/content/NewsletterDataUpdate.php
M includes/content/NewsletterDiffEngine.php
M includes/logging/NewsletterLogFormatter.php
M includes/specials/SpecialNewsletter.php
M includes/specials/SpecialNewsletterCreate.php
M includes/specials/SpecialNewsletters.php
M includes/specials/pagers/NewsletterTablePager.php
M maintenance/deleteInactiveNewsletters.php
M maintenance/updateSubscribersCount.php
R tests/api/ApiNewsletterSubscribeTest.php
M tests/specials/SpecialNewsletterCreateTest.php
M tests/specials/SpecialNewslettersTest.php
24 files changed, 52 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/80/400580/1

diff --git a/NewsletterHooks.php b/NewsletterHooks.php
index de9205c..2e1112d 100644
--- a/NewsletterHooks.php
+++ b/NewsletterHooks.php
@@ -8,8 +8,8 @@
/**
 * Function to be called before EchoEvent
 *
-* @param array &$notifications Echo notifications
-* @param array &$notificationCategories Echo notification categories
+* @param array[] &$notifications Echo notifications
+* @param array[] &$notificationCategories Echo notification categories
 * @return bool
 */
public static function onBeforeCreateEchoEvent( &$notifications, 
&$notificationCategories ) {
@@ -394,4 +394,5 @@
 
return true;
}
+
 }
diff --git a/includes/Echo/BaseNewsletterPresentationModel.php 
b/includes/Echo/BaseNewsletterPresentationModel.php
index 40f8da9..50f7ddd 100644
--- a/includes/Echo/BaseNewsletterPresentationModel.php
+++ b/includes/Echo/BaseNewsletterPresentationModel.php
@@ -1,6 +1,7 @@
 getNewsletterId() );
return (bool)$nl;
@@ -27,4 +28,5 @@
}
return $result;
}
+
 }
diff --git a/includes/Echo/EchoNewsletterPresentationModel.php 
b/includes/Echo/EchoNewsletterPresentationModel.php
index b7ed667..425f933 100644
--- a/includes/Echo/EchoNewsletterPresentationModel.php
+++ b/includes/Echo/EchoNewsletterPresentationModel.php
@@ -42,4 +42,5 @@
return $this->msg( 'notification-body-newsletter-announce' )
->params( $this->event->getExtraParam( 'section-text' ) 
);
}
+
 }
diff --git a/includes/Echo/EchoNewsletterPublisherAddedPresentationModel.php 
b/includes/Echo/EchoNewsletterPublisherAddedPresentationModel.php
index f20d5e5..1c83b5b 100644
--- a/includes/Echo/EchoNewsletterPublisherAddedPresentationModel.php
+++ b/includes/Echo/EchoNewsletterPublisherAddedPresentationModel.php
@@ -21,4 +21,5 @@
$msg->params( $agentGenderName );
return $msg;
}
+
 }
diff --git a/includes/Echo/EchoNewsletterSubscribedPresentationModel.php 
b/includes/Echo/EchoNewsletterSubscribedPresentationModel.php
index 3a9ff32..9a2cf7d 100644
--- a/includes/Echo/EchoNewsletterSubscribedPresentationModel.php
+++ b/includes/Echo/EchoNewsletterSubscribedPresentationModel.php
@@ -20,4 +20,5 @@
$msg->params( $this->getNewsletterName() );
return $msg;
}
+
 }
diff --git a/includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php 
b/includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php
index b050aa5..c50c880 100644
--- a/includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php
+++ b/includes/Echo/EchoNewsletterUnsubscribedPresentationModel.php
@@ -20,4 +20,5 @@
$msg->params( $this->getNewsletterName() );
return $msg;
}
+
 }
diff --git a/includes/Echo/EchoNewsletterUserLocator.php 
b/includes/Echo/EchoNewsletterUserLocator.php
index f674bc7..023ca47 100644
--- a/includes/Echo/EchoNewsletterUserLocator.php
+++ b/includes/Echo/EchoNewsletterUserLocator.php
@@ -1,6 +1,7 @@
 getSubscribers() );
}
+
 }
diff --git a/includes/Newsletter.php b/includes/Newsletter.php
index 46a5753..5fbf290 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Use ExtensionRegistry instead of class_exists

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400576 )

Change subject: Use ExtensionRegistry instead of class_exists
..

Use ExtensionRegistry instead of class_exists

Bug: T183096
Change-Id: I524dcf3dd33d561728afee5ca3f4ae3349924df4
---
M includes/CirrusSearch.php
M includes/SiteMatrixInterwikiResolver.php
2 files changed, 6 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/76/400576/1

diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index b5c2725..a5a36ac 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -545,7 +545,7 @@
}
 
if ( $useCompletion === 'beta' ) {
-   return class_exists( '\BetaFeatures' ) &&
+   return ExtensionRegistry::getInstance()->isLoaded( 
'BetaFeatures' ) &&
\BetaFeatures::isFeatureEnabled( 
$GLOBALS['wgUser'], 'cirrussearch-completionsuggester' );
}
 
diff --git a/includes/SiteMatrixInterwikiResolver.php 
b/includes/SiteMatrixInterwikiResolver.php
index 0328b35..a6cbbf5 100644
--- a/includes/SiteMatrixInterwikiResolver.php
+++ b/includes/SiteMatrixInterwikiResolver.php
@@ -2,6 +2,7 @@
 
 namespace CirrusSearch;
 
+use ExtensionRegistry;
 use \ObjectCache;
 use \SiteMatrix;
 use MediaWiki\MediaWikiServices;
@@ -25,7 +26,7 @@
if ( $config->getWikiId() !== wfWikiID() ) {
throw new \RuntimeException( "This resolver cannot with 
an external wiki config. (config: " . $config->getWikiId() . ", global: " . 
wfWikiID() );
}
-   if ( !class_exists( SiteMatrix::class ) ) {
+   if ( !ExtensionRegistry::getInstance()->isLoaded( 'SiteMatrix' 
) ) {
throw new \RuntimeException( "SiteMatrix is required" );
}
if ( !$this->config->has( 'SiteMatrixSites' ) ) {
@@ -38,16 +39,9 @@
 * @return bool true if this resolver can run with the specified config
 */
public static function accepts( SearchConfig $config ) {
-   if ( $config->getWikiId() !== wfWikiID() ) {
-   return false;
-   }
-   if ( !class_exists( SiteMatrix::class ) ) {
-   return false;
-   }
-   if ( !$config->has( 'SiteMatrixSites' ) ) {
-   return false;
-   }
-   return true;
+   return $config->getWikiId() === wfWikiID()
+   && ExtensionRegistry::getInstance()->isLoaded( 
'SiteMatrix' )
+   && $config->has( 'SiteMatrixSites' );
}
 
protected function loadMatrix() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I524dcf3dd33d561728afee5ca3f4ae3349924df4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Remove some superfluous parameter descriptions

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400575 )

Change subject: Remove some superfluous parameter descriptions
..

Remove some superfluous parameter descriptions

These text snippets do not explain anything. One could argue they are
worse than having no description, because they must be read first to
understand they do not explain anything.

Change-Id: I1b6c8898093b989ffe336391f5aee90d549a388f
---
M includes/CompletionSuggester.php
M includes/Maintenance/Validators/Validator.php
M includes/Query/FullTextQueryStringQueryBuilder.php
M includes/Sanity/Checker.php
M includes/Search/RescoreBuilders.php
M includes/Search/ResultsType.php
M includes/Util.php
M tests/jenkins/Jenkins.php
M tests/unit/InterwikiResolverTest.php
9 files changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/75/400575/1

diff --git a/includes/CompletionSuggester.php b/includes/CompletionSuggester.php
index e553aca..70cff33 100644
--- a/includes/CompletionSuggester.php
+++ b/includes/CompletionSuggester.php
@@ -128,7 +128,7 @@
/**
 * @param Connection $conn
 * @param int $limit Limit the results to this many
-* @param int $offset the offset
+* @param int $offset
 * @param SearchConfig $config Configuration settings
 * @param int[]|null $namespaces Array of namespace numbers to search 
or null to search all namespaces.
 * @param User|null $user user for which this search is being 
performed.  Attached to slow request logs.
diff --git a/includes/Maintenance/Validators/Validator.php 
b/includes/Maintenance/Validators/Validator.php
index 74fd204..cd05778 100644
--- a/includes/Maintenance/Validators/Validator.php
+++ b/includes/Maintenance/Validators/Validator.php
@@ -84,8 +84,8 @@
 * false so we normalize everything.  Sometimes, oddly, it'll through 
back false
 * for false
 *
-* @param mixed $value config value
-* @return mixed value normalized
+* @param mixed $value
+* @return mixed
 */
private function normalizeConfigValue( $value ) {
if ( $value === true ) {
diff --git a/includes/Query/FullTextQueryStringQueryBuilder.php 
b/includes/Query/FullTextQueryStringQueryBuilder.php
index 0c727b3..6a0458d 100644
--- a/includes/Query/FullTextQueryStringQueryBuilder.php
+++ b/includes/Query/FullTextQueryStringQueryBuilder.php
@@ -388,8 +388,8 @@
 * The query 'the query' and the fields all and all.plain will be like
 * (all:the OR all.plain:the) AND (all:query OR all.plain:query)
 *
-* @param string[] $fields the fields
-* @param string $queryString the query
+* @param string[] $fields
+* @param string $queryString
 * @param integer $phraseSlop phrase slop
 * @return \Elastica\Query\QueryString
 */
diff --git a/includes/Sanity/Checker.php b/includes/Sanity/Checker.php
index bfb696b..8f1120d 100644
--- a/includes/Sanity/Checker.php
+++ b/includes/Sanity/Checker.php
@@ -163,7 +163,7 @@
 
/**
 * Check if the page is a redirect
-* @param WikiPage $page the page
+* @param WikiPage $page
 * @return bool true if $page is a redirect
 */
private function checkIfRedirect( $page ) {
diff --git a/includes/Search/RescoreBuilders.php 
b/includes/Search/RescoreBuilders.php
index 3119a01..438198b 100644
--- a/includes/Search/RescoreBuilders.php
+++ b/includes/Search/RescoreBuilders.php
@@ -668,7 +668,7 @@
/**
 * Get the weight of a namespace.
 *
-* @param int $namespace the namespace
+* @param int $namespace
 * @return float the weight of the namespace
 */
private function getBoostForNamespace( $namespace ) {
diff --git a/includes/Search/ResultsType.php b/includes/Search/ResultsType.php
index 372ef36..b41d531 100644
--- a/includes/Search/ResultsType.php
+++ b/includes/Search/ResultsType.php
@@ -510,7 +510,7 @@
/**
 * @param array &$config
 * @param array $highlightSource
-* @param array $options various options
+* @param array $options
 */
private function configureHighlightingForSource( array &$config, array 
$highlightSource, array $options ) {
global $wgCirrusSearchRegexMaxDeterminizedStates,
diff --git a/includes/Util.php b/includes/Util.php
index 4d5f9e1..8790f65 100644
--- a/includes/Util.php
+++ b/includes/Util.php
@@ -204,7 +204,7 @@
 * Test if $string ends with $suffix
 *
 * @param string $string string to test
-* @param string $suffix the suffix
+* @param string $suffix
 * @return bool true if $string ends with $suffix
 */
public static function endsWith( $string, $suffix 

[MediaWiki-commits] [Gerrit] mediawiki...SemanticGenealogy[master]: Remove obvious, non-helpful documentation snippets

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400574 )

Change subject: Remove obvious, non-helpful documentation snippets
..

Remove obvious, non-helpful documentation snippets

Describing a parameter as "the parameter" does not add anything. It's
actually worse than having no documentation, because one must read it
first to understand it doesn't explain anything.

Change-Id: Icc54ee733d19e56efc5a63417307d948064825f5
---
M Gedcom5FilePrinter.php
M Gedcom5ResultPrinter.php
M PersonPageValues.php
M Tools.php
M src/Tree/DescendantListFamilyTree.php
M src/Tree/FamilyTree.php
M src/Tree/LinkFamilyTree.php
7 files changed, 19 insertions(+), 33 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticGenealogy 
refs/changes/74/400574/1

diff --git a/Gedcom5FilePrinter.php b/Gedcom5FilePrinter.php
index 47b3787..c509ebd 100644
--- a/Gedcom5FilePrinter.php
+++ b/Gedcom5FilePrinter.php
@@ -151,7 +151,7 @@
 * Add the GEDCOM for a person
 *
 * @param integer $personId the id of the person
-* @param object $person PersonPageValues object
+* @param PersonPageValues $person
 *
 * @return void
 */
@@ -202,7 +202,7 @@
/**
 * Get the gedcom name
 *
-* @param object $person the person object
+* @param PersonPageValues $person
 *
 * @return string the name for the gedcom
 */
@@ -224,8 +224,8 @@
 * Adds a row
 *
 * @param string $level the level of the row
-* @param string $key the key
-* @param object $value the value
+* @param string $key
+* @param object $value
 *
 * @return void
 */
@@ -242,9 +242,9 @@
 *
 * TODO add places metadata support.
 *
-* @param string $type the type
-* @param string $date the date
-* @param string $place the place
+* @param string $type
+* @param string $date
+* @param string $place
 *
 * @return void
 */
@@ -265,7 +265,7 @@
 * Adds a row from string value
 *
 * @param string $level the level of the row
-* @param string $key the key
+* @param string $key
 * @param object $value the string value
 *
 * @return void
@@ -280,7 +280,7 @@
 * Adds a row from time value
 *
 * @param string $level the level of the row
-* @param string $key the key
+* @param string $key
 * @param object $value the time value
 *
 * @return void
@@ -297,7 +297,7 @@
 * Adds a row from the wiki page
 *
 * @param string $level the level of the row
-* @param string $key the key
+* @param string $key
 * @param object $value the wiki page value
 *
 * @return void
diff --git a/Gedcom5ResultPrinter.php b/Gedcom5ResultPrinter.php
index d86e993..6c12d43 100644
--- a/Gedcom5ResultPrinter.php
+++ b/Gedcom5ResultPrinter.php
@@ -41,7 +41,7 @@
/**
 * Get the query mode
 *
-* @param string $context the context
+* @param string $context
 *
 * @return string the query mode
 */
@@ -62,7 +62,7 @@
/**
 * Get the result test of the result printer
 *
-* @param SMWQueryResult $res the result
+* @param SMWQueryResult $res
 * @param integer $outputmode the output mode chosen
 *
 * @return string the result text
diff --git a/PersonPageValues.php b/PersonPageValues.php
index 93c0c10..8fe5559 100644
--- a/PersonPageValues.php
+++ b/PersonPageValues.php
@@ -31,7 +31,7 @@
/**
 * Constructor for a single indi in the file.
 *
-* @param SMWDIWikiPage $page the page
+* @param SMWDIWikiPage $page
 */
public function __construct( SMWDIWikiPage $page ) {
$values = [];
diff --git a/Tools.php b/Tools.php
index f546378..6dcefe6 100644
--- a/Tools.php
+++ b/Tools.php
@@ -7,8 +7,8 @@
/**
 * Find the subclasses of that superclass in one directory
 *
-* @param string $dir the directory
-* @param string $superClass the superclass name
+* @param string $dir
+* @param string $superClass
 *
 * @return array an array of $classes subclass of the superClass
 */
diff --git a/src/Tree/DescendantListFamilyTree.php 
b/src/Tree/DescendantListFamilyTree.php
index e6e7490..94bb130 100644
--- a/src/Tree/DescendantListFamilyTree.php
+++ b/src/Tree/DescendantListFamilyTree.php
@@ -18,7 +18,7 @@
/**
 * List the descendants for all needed generations
 *
-* @param PersonPageValues $person the person object
+* @param PersonPageValues 

[MediaWiki-commits] [Gerrit] mediawiki...EducationProgram[master]: Slightly improve some type hints in PHPDoc blocks

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400573 )

Change subject: Slightly improve some type hints in PHPDoc blocks
..

Slightly improve some type hints in PHPDoc blocks

Change-Id: I2b0962e293fe9e00a8b3f5933c22f8509d85039a
---
M includes/Extension.php
M includes/rows/RevisionedObject.php
M includes/specials/SpecialEducationProgram.php
M includes/tables/IORMTable.php
M tests/phpunit/Events/RecentPageEventGrouperTest.php
5 files changed, 14 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram 
refs/changes/73/400573/1

diff --git a/includes/Extension.php b/includes/Extension.php
index 8a9f08a..b4f1677 100644
--- a/includes/Extension.php
+++ b/includes/Extension.php
@@ -104,7 +104,6 @@
}
 
/**
-*
 * Get the singleton NotificationsManager. If it doesn't exist yet, we
 * create it and set it up.
 *
diff --git a/includes/rows/RevisionedObject.php 
b/includes/rows/RevisionedObject.php
index 4250866..d698696 100644
--- a/includes/rows/RevisionedObject.php
+++ b/includes/rows/RevisionedObject.php
@@ -32,7 +32,6 @@
protected $storeRevisions = true;
 
/**
-*
 * @since 0.1
 * @var RevisionAction|bool false
 */
@@ -498,7 +497,6 @@
 
/**
 * Set a field to the value of the corresponding field in the provided 
object.
-*
 *
 * @since 0.1
 * @param string $fieldName
diff --git a/includes/specials/SpecialEducationProgram.php 
b/includes/specials/SpecialEducationProgram.php
index d5ebdc9..762e019 100644
--- a/includes/specials/SpecialEducationProgram.php
+++ b/includes/specials/SpecialEducationProgram.php
@@ -211,7 +211,7 @@
 *
 * @since 0.1
 *
-* @param array $terms
+* @param array[] $terms
 *
 * @return string
 */
@@ -252,7 +252,7 @@
 *
 * @since 0.1
 *
-* @return array
+* @return array[]
 */
protected function getTermData() {
$termNames = Courses::singleton()->selectFields( 'term', [], [ 
'DISTINCT' ] );
@@ -313,12 +313,12 @@
 *
 * @since 0.1
 *
-* @param array $students
-* @param array $oas
-* @param array $cas
-* @param array $instructors
+* @param int[] $students
+* @param int[] $oas
+* @param int[] $cas
+* @param int[] $instructors
 *
-* @return array
+* @return float[]
 */
protected function getByGender( array $students, array $oas, array 
$cas, array $instructors ) {
$genders = $this->getGenders(
@@ -340,10 +340,10 @@
 *
 * @since 0.1
 *
-* @param array $users The users
-* @param array $genders An array mapping user id to gender
+* @param int[] $users User IDs
+* @param string[] $genders An array mapping user id to gender
 *
-* @return array
+* @return float[]
 */
protected function getGenderDistribution( array $users, array $genders 
) {
$distribution = [ 'unknown' => 0, 'male' => 0, 'female' => 0 ];
@@ -366,9 +366,9 @@
 *
 * @since 0.1
 *
-* @param array $userIds
+* @param int[] $userIds
 *
-* @return array
+* @return string[]
 */
protected function getGenders( array $userIds ) {
$dbr = wfGetDB( DB_REPLICA );
diff --git a/includes/tables/IORMTable.php b/includes/tables/IORMTable.php
index e904b1a..94783ca 100644
--- a/includes/tables/IORMTable.php
+++ b/includes/tables/IORMTable.php
@@ -380,7 +380,7 @@
 *
 * @see LoadBalancer::reuseConnection
 *
-* @param Database $db The database
+* @param Database $db
 *
 * @since 1.20
 */
diff --git a/tests/phpunit/Events/RecentPageEventGrouperTest.php 
b/tests/phpunit/Events/RecentPageEventGrouperTest.php
index 3904497..e8307d8 100644
--- a/tests/phpunit/Events/RecentPageEventGrouperTest.php
+++ b/tests/phpunit/Events/RecentPageEventGrouperTest.php
@@ -42,7 +42,7 @@
$groupedEvents = $grouper->groupEvents( [] );
 
$this->assertInternalType( 'array', $groupedEvents );
-   $this->assertCount( 0, $groupedEvents );
+   $this->assertEmpty( $groupedEvents );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b0962e293fe9e00a8b3f5933c22f8509d85039a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Add missing @param docs and such

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400572 )

Change subject: Add missing @param docs and such
..

Add missing @param docs and such

This also removes some redundant bits of text that do not add much to
whats already obvious from the variable name and the type.

Change-Id: I173b2c0e8fe5f56ff385b3389440a27130c60294
---
M src/ConstraintCheck/Context/ApiV2Context.php
M src/ConstraintCheck/Context/Context.php
M tests/phpunit/ConstraintParameters.php
M tests/phpunit/Fake/FakeSnakContext.php
4 files changed, 32 insertions(+), 21 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/72/400572/1

diff --git a/src/ConstraintCheck/Context/ApiV2Context.php 
b/src/ConstraintCheck/Context/ApiV2Context.php
index b693b10..9a8a48f 100644
--- a/src/ConstraintCheck/Context/ApiV2Context.php
+++ b/src/ConstraintCheck/Context/ApiV2Context.php
@@ -24,17 +24,17 @@
/**
 * Returns the statement subcontainer.
 *
-* @param array &$container
-* @param string $entityId entity ID serialization
-* @param string $propertyId property ID serialization
-* @param string $statementId statement GUID
+* @param array[] &$container
+* @param string $entityId
+* @param string $propertyId
+* @param string $statementGuid
 * @return array
 */
protected function (
array &$container,
$entityId,
$propertyId,
-   $statementId
+   $statementGuid
) {
if ( !array_key_exists( $entityId, $container ) ) {
$container[$entityId] = [];
@@ -52,13 +52,13 @@
$propertyContainer = &$claimsContainer[$propertyId];
 
foreach ( $propertyContainer as &$statement ) {
-   if ( $statement['id'] === $statementId ) {
+   if ( $statement['id'] === $statementGuid ) {
$statementArray = &$statement;
break;
}
}
if ( !isset( $statementArray ) ) {
-   $statementArray = [ 'id' => $statementId ];
+   $statementArray = [ 'id' => $statementGuid ];
$propertyContainer[] = &$statementArray;
}
 
@@ -70,11 +70,15 @@
 * It should locate the array in $container or,
 * if the array doesn’t exist yet, create it and emplace it there.
 *
-* @param array &$container
+* @param array[] &$container
 * @return array
 */
abstract protected function ( array &$container );
 
+   /**
+* @param array|null $result
+* @param array[] &$container
+*/
public function storeCheckResultInArray( $result, array &$container ) {
$mainArray = &$this->getMainArray( $container );
if ( !array_key_exists( 'results', $mainArray ) ) {
diff --git a/src/ConstraintCheck/Context/Context.php 
b/src/ConstraintCheck/Context/Context.php
index 844bc8b..e36412f 100644
--- a/src/ConstraintCheck/Context/Context.php
+++ b/src/ConstraintCheck/Context/Context.php
@@ -84,7 +84,7 @@
 * but still populate the appropriate location for this context in 
$container.
 *
 * @param array|null $result
-* @param array &$container
+* @param array[] &$container
 */
public function storeCheckResultInArray( $result, array &$container );
 
diff --git a/tests/phpunit/ConstraintParameters.php 
b/tests/phpunit/ConstraintParameters.php
index b434b5e..59ef20f 100644
--- a/tests/phpunit/ConstraintParameters.php
+++ b/tests/phpunit/ConstraintParameters.php
@@ -87,7 +87,7 @@
 
/**
 * @param string[] $classIds item ID serializations
-* @return array
+* @return array[]
 */
public function classParameter( array $classIds ) {
$classParameterId = $this->getDefaultConfig()->get( 
'WBQualityConstraintsClassId' );
@@ -108,7 +108,7 @@
 
/**
 * @param string $relation 'instance' or 'subclass'
-* @return array
+* @return array[]
 */
public function relationParameter( $relation ) {
$relationParameterId = $this->getDefaultConfig()->get( 
'WBQualityConstraintsRelationId' );
@@ -133,8 +133,8 @@
}
 
/**
-* @param string $propertyId property ID serialization
-* @return array
+* @param string $propertyId
+* @return array[]
 */
public function propertyParameter( $propertyId ) {
$propertyParameterId = $this->getDefaultConfig()->get( 
'WBQualityConstraintsPropertyId' );
@@ -150,7 +150,7 @@
 
/**
 * 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove spaces from the "Wikibase …" extension names

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400570 )

Change subject: Remove spaces from the "Wikibase …" extension names
..

Remove spaces from the "Wikibase …" extension names

Look at https://www.wikidata.org/wiki/Special:Version
No other extension's name contains spaces.

Warning! We must check if these extension names are really not used
anywhere else. We already confirmed these extention names are *not*
used in ExtensionRegistry checks (see I963704c).

But wikiapiary was mentioned.

Change-Id: Ib80b820723d0ff047c4be6dc41661b0d38019145
---
M client/WikibaseClient.php
M repo/Wikibase.php
M view/init.mw.php
3 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/70/400570/1

diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php
index 0afc343..f2601eb 100644
--- a/client/WikibaseClient.php
+++ b/client/WikibaseClient.php
@@ -99,7 +99,7 @@
 
$wgExtensionCredits['wikibase'][] = array(
'path' => __DIR__,
-   'name' => 'Wikibase Client',
+   'name' => 'WikibaseClient',
'author' => array(
'The Wikidata team',
),
diff --git a/repo/Wikibase.php b/repo/Wikibase.php
index d87bb096..3a38a98 100644
--- a/repo/Wikibase.php
+++ b/repo/Wikibase.php
@@ -98,11 +98,11 @@
 
$wgExtensionCredits['wikibase'][] = [
'path' => __DIR__,
-   'name' => 'Wikibase Repository',
+   'name' => 'WikibaseRepository',
'author' => [
'The Wikidata team',
],
-   'url' => 'https://www.mediawiki.org/wiki/Extension:Wikibase',
+   'url' => 
'https://www.mediawiki.org/wiki/Extension:Wikibase_Repository',
'descriptionmsg' => 'wikibase-desc',
'license-name' => 'GPL-2.0+'
];
diff --git a/view/init.mw.php b/view/init.mw.php
index 82f9459..3af3e44 100644
--- a/view/init.mw.php
+++ b/view/init.mw.php
@@ -6,7 +6,7 @@
 
 $GLOBALS['wgExtensionCredits']['wikibase'][] = [
'path' => __DIR__,
-   'name' => 'Wikibase View',
+   'name' => 'WikibaseView',
'author' => [
'The Wikidata team',
],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib80b820723d0ff047c4be6dc41661b0d38019145
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove some obvious, self-explaining PHPDoc snippets

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400569 )

Change subject: Remove some obvious, self-explaining PHPDoc snippets
..

Remove some obvious, self-explaining PHPDoc snippets

Having a snippet of documentation that does not add anything to whats
already obvious from the function/variable names and types is worse
than having no documentation: it must be maintained, and one must read
it first to understand it does not explain anything.

Change-Id: Ie86727322daf6d1877fb498bb54674660d2c2b89
---
M client/includes/LangLinkHandler.php
M lib/includes/Store/EntityStore.php
M lib/includes/Store/TermPropertyLabelResolver.php
M lib/tests/phpunit/MockRepository.php
M repo/Wikibase.hooks.php
M repo/includes/Content/EntityContent.php
M repo/includes/Content/EntityHandler.php
M repo/includes/Store/Sql/SqlStore.php
M repo/includes/Store/Sql/WikiPageEntityStore.php
M repo/maintenance/searchEntities.php
M tests/phan/stubs/scribunto.php
11 files changed, 15 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/69/400569/1

diff --git a/client/includes/LangLinkHandler.php 
b/client/includes/LangLinkHandler.php
index 222c3cd..0d14604 100644
--- a/client/includes/LangLinkHandler.php
+++ b/client/includes/LangLinkHandler.php
@@ -62,8 +62,8 @@
/**
 * @param LanguageLinkBadgeDisplay $badgeDisplay
 * @param NamespaceChecker $namespaceChecker determines which 
namespaces wikibase is enabled on
-* @param SiteLinkLookup $siteLinkLookup A site link lookup service
-* @param EntityLookup $entityLookup An entity lookup service
+* @param SiteLinkLookup $siteLinkLookup
+* @param EntityLookup $entityLookup
 * @param SiteLookup $siteLookup
 * @param string $siteId The global site ID for the local wiki
 * @param string $siteGroup The ID of the site group to use for showing 
language links.
diff --git a/lib/includes/Store/EntityStore.php 
b/lib/includes/Store/EntityStore.php
index 689584a..b3330b2 100644
--- a/lib/includes/Store/EntityStore.php
+++ b/lib/includes/Store/EntityStore.php
@@ -98,7 +98,7 @@
 *
 * @see EditPage::userWasLastToEdit()
 *
-* @param User $user the user
+* @param User $user
 * @param EntityId $id the entity to check
 * @param int $lastRevId the revision to check from
 *
diff --git a/lib/includes/Store/TermPropertyLabelResolver.php 
b/lib/includes/Store/TermPropertyLabelResolver.php
index d3218d4..9869e94 100644
--- a/lib/includes/Store/TermPropertyLabelResolver.php
+++ b/lib/includes/Store/TermPropertyLabelResolver.php
@@ -78,7 +78,7 @@
}
 
/**
-* @param string[] $labels the labels
+* @param string[] $labels
 * @param string $recache Flag, set to 'recache' to fetch fresh data 
from the database.
 *
 * @return EntityId[] a map of strings from $labels to the 
corresponding entity ID.
diff --git a/lib/tests/phpunit/MockRepository.php 
b/lib/tests/phpunit/MockRepository.php
index 52cb066..157d82a 100644
--- a/lib/tests/phpunit/MockRepository.php
+++ b/lib/tests/phpunit/MockRepository.php
@@ -556,7 +556,7 @@
 *
 * @see EditPage::userWasLastToEdit
 *
-* @param User $user the user
+* @param User $user
 * @param EntityId $entityId the entity to check
 * @param int $lastRevisionId the revision to check from
 *
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index ee2304b..d56e039 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -635,7 +635,7 @@
 * Hook handler for AbuseFilter's AbuseFilter-contentToString hook, 
implemented
 * to provide a custom text representation of Entities for filtering.
 *
-* @param Content $content The content object
+* @param Content $content
 * @param string  &$text The resulting text
 *
 * @return bool
diff --git a/repo/includes/Content/EntityContent.php 
b/repo/includes/Content/EntityContent.php
index 7beea52..e5605ff 100644
--- a/repo/includes/Content/EntityContent.php
+++ b/repo/includes/Content/EntityContent.php
@@ -6,6 +6,7 @@
 use Article;
 use Content;
 use DataUpdate;
+use DeferrableUpdate;
 use Diff\Differ\MapDiffer;
 use Diff\DiffOp\Diff\Diff;
 use Diff\Patcher\MapPatcher;
@@ -141,7 +142,7 @@
 * @param WikiPage $page
 * @param ParserOutput|null $parserOutput
 *
-* @return DataUpdate[]
+* @return DeferrableUpdate[]
 */
public function getDeletionUpdates( WikiPage $page, ParserOutput 
$parserOutput = null ) {
/* @var EntityHandler $handler */
diff --git a/repo/includes/Content/EntityHandler.php 
b/repo/includes/Content/EntityHandler.php
index fa31219..e4b0777 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki...Cognate[master]: Update inline documentation

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400566 )

Change subject: Update inline documentation
..

Update inline documentation

Change-Id: I1b44ed37c096af04e27387721952842d999fedaa
---
M src/CognateHooks.php
M src/CognateStore.php
M src/CognateUpdater.php
M src/hooks/CognatePageHookHandler.php
4 files changed, 11 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cognate 
refs/changes/66/400566/1

diff --git a/src/CognateHooks.php b/src/CognateHooks.php
index 865a08f..b0dd233 100644
--- a/src/CognateHooks.php
+++ b/src/CognateHooks.php
@@ -81,7 +81,7 @@
 *
 * @see CognateUpdater regarding the complexities of this hook
 *
-* @param DatabaseUpdater $updater DatabaseUpdater object
+* @param DatabaseUpdater $updater
 * @return bool
 */
public static function onLoadExtensionSchemaUpdates( DatabaseUpdater 
$updater ) {
diff --git a/src/CognateStore.php b/src/CognateStore.php
index 469da7b..926d274 100644
--- a/src/CognateStore.php
+++ b/src/CognateStore.php
@@ -323,7 +323,10 @@
 
/**
 * Delete all entries from the cognate_pages table for the given site.
+*
 * @param string $dbName The dbname of the site to delete pages for.
+*
+* @throws RuntimeException if not run in a maintenance or test scope
 */
public function deletePagesForSite( $dbName ) {
if ( !defined( 'RUN_MAINTENANCE_IF_MAIN' ) && !defined( 
'MW_PHPUNIT_TEST' ) ) {
diff --git a/src/CognateUpdater.php b/src/CognateUpdater.php
index 8f63fd4..797b51a 100644
--- a/src/CognateUpdater.php
+++ b/src/CognateUpdater.php
@@ -63,7 +63,7 @@
 
/**
 * @suppress PhanTypeMissingReturn
-* @return array
+* @return null
 */
protected function getCoreUpdateList() {
// not used but is abstract and must be implemented
diff --git a/src/hooks/CognatePageHookHandler.php 
b/src/hooks/CognatePageHookHandler.php
index 342cbb8..96065c7 100644
--- a/src/hooks/CognatePageHookHandler.php
+++ b/src/hooks/CognatePageHookHandler.php
@@ -68,14 +68,14 @@
 * Occurs after the save page request has been processed.
 * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/PageContentSaveComplete
 *
-* @param WikiPage $page
-* @param User $user
+* @param WikiPage &$page
+* @param User &$user
 * @param Content $content
 * @param string $summary
-* @param boolean $isMinor
-* @param boolean $isWatch
-* @param mixed $section Deprecated
-* @param integer $flags
+* @param bool $isMinor
+* @param null $isWatch No longer used
+* @param null $section No longer used
+* @param int &$flags
 * @param Revision|null $revision
 * @param Status $status
 * @param integer $baseRevId

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b44ed37c096af04e27387721952842d999fedaa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cognate
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cognate[master]: Add more strict type hints to hook handlers

2017-12-28 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400567 )

Change subject: Add more strict type hints to hook handlers
..

Add more strict type hints to hook handlers

Thi spatch also contains a few other minor cleanups that are closely
related, but not purely documentation.

Change-Id: I56b2b20771bf993ec387f972c42b4f67327b51a3
---
M src/CognateHooks.php
M src/CognateStore.php
M src/CognateUpdater.php
M src/hooks/CognatePageHookHandler.php
M tests/phpunit/hooks/CognatePageHookHandlerTest.php
5 files changed, 32 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cognate 
refs/changes/67/400567/1

diff --git a/src/CognateHooks.php b/src/CognateHooks.php
index b0dd233..10b8c38 100644
--- a/src/CognateHooks.php
+++ b/src/CognateHooks.php
@@ -4,10 +4,14 @@
 
 use Content;
 use DatabaseUpdater;
+use DataUpdate;
+use DeferrableUpdate;
 use MediaWiki\MediaWikiServices;
+use Page;
 use ParserOutput;
 use Title;
 use Wikimedia\Rdbms\LoadBalancer;
+use WikiPage;
 
 /**
  * @license GNU GPL v2+
@@ -27,7 +31,18 @@
return true;
}
 
-   public static function onWikiPageDeletionUpdates( $page, $content, 
&$updates ) {
+   /**
+* @param WikiPage $page
+* @param Content|null $content
+* @param DeferrableUpdate[] $updates
+*
+* @return bool
+*/
+   public static function onWikiPageDeletionUpdates(
+   WikiPage $page,
+   Content $content = null,
+   array &$updates
+   ) {
MediaWikiServices::getInstance()
->getService( 'CognatePageHookHandler' )
->onWikiPageDeletionUpdates( $page, $content, $updates 
);
diff --git a/src/CognateStore.php b/src/CognateStore.php
index 926d274..2d1a8ab 100644
--- a/src/CognateStore.php
+++ b/src/CognateStore.php
@@ -79,10 +79,7 @@
 
$dbr = $this->connectionManager->getReadConnection();
 
-   list( $pagesToInsert, $titlesToInsert ) = $this->buildRows(
-   $linkTarget,
-   $dbName
-   );
+   list( $pagesToInsert, $titlesToInsert ) = $this->buildRows( 
$linkTarget, $dbName );
 
$row = $dbr->selectRow(
self::TITLES_TABLE_NAME,
diff --git a/src/CognateUpdater.php b/src/CognateUpdater.php
index 797b51a..4ea82cb 100644
--- a/src/CognateUpdater.php
+++ b/src/CognateUpdater.php
@@ -43,7 +43,7 @@
Database $mainDb,
Database $cognateDb,
$shared = false,
-   $maintenance = null
+   Maintenance $maintenance = null
) {
$updater = parent::newForDB(
$mainDb,
diff --git a/src/hooks/CognatePageHookHandler.php 
b/src/hooks/CognatePageHookHandler.php
index 96065c7..f6f6986 100644
--- a/src/hooks/CognatePageHookHandler.php
+++ b/src/hooks/CognatePageHookHandler.php
@@ -6,6 +6,7 @@
 use DeferrableUpdate;
 use MediaWiki\Linker\LinkTarget;
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\RevisionRecord;
 use MWCallableUpdate;
 use MWException;
 use Revision;
@@ -77,8 +78,9 @@
 * @param null $section No longer used
 * @param int &$flags
 * @param Revision|null $revision
-* @param Status $status
-* @param integer $baseRevId
+* @param Status &$status
+* @param int|bool $baseRevId
+* @param int $undidRevId
 */
public function onPageContentSaveComplete(
WikiPage $page,
@@ -89,9 +91,10 @@
$isWatch,
$section,
$flags,
-   $revision,
+   Revision $revision = null,
Status $status,
-   $baseRevId
+   $baseRevId,
+   $undidRevId
) {
// A null revision means a null edit / no-op edit was made, no 
need to process that.
if ( $revision === null ) {
@@ -103,10 +106,9 @@
}
 
$previousRevision = $revision->getPrevious();
-   $previousContent =
-   $previousRevision ?
-   $previousRevision->getContent( Revision::RAW ) :
-   null;
+   $previousContent = $previousRevision
+   ? $previousRevision->getContent( RevisionRecord::RAW )
+   : null;
 
$this->onContentChange(
$page->getTitle()->getTitleValue(),
@@ -173,7 +175,7 @@
$this->onContentChange(
$title->getTitleValue(),
true,
-   $revision->getContent( Revision::RAW )->isRedirect(),
+   $revision->getContent( RevisionRecord::RAW 

[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Remove redundant documentation snippets

2017-12-27 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400417 )

Change subject: Remove redundant documentation snippets
..

Remove redundant documentation snippets

Change-Id: I81505f5f640776cf875a3620f9bda3a8ba4d3f33
---
M maintenance/PopulateDatabase.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/maintenance/PopulateDatabase.php b/maintenance/PopulateDatabase.php
index a3fc13a..e79a24e 100644
--- a/maintenance/PopulateDatabase.php
+++ b/maintenance/PopulateDatabase.php
@@ -105,8 +105,8 @@
 * Process several edits and store the scores in the database
 *
 * @param array $revs array of revision ids
-* @param Scoring $scoring scoring object
-* @param Cache $cache cahe object
+* @param Scoring $scoring
+* @param Cache $cache
 */
private function processScores( array $revs, Scoring $scoring, Cache 
$cache ) {
$size = count( $revs );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81505f5f640776cf875a3620f9bda3a8ba4d3f33
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Utilize the …::class feature instead of class names in strings

2017-12-27 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400413 )

Change subject: Utilize the …::class feature instead of class names in strings
..

Utilize the …::class feature instead of class names in strings

Yes, the …::class feature works, even if a class is not available. It's
technically still a string. However, most tools can much easier understand
that the string before …::class refers to a class name, and properly warn
when the class is renamed or moved to an other namespace.

note this conflicts with I4e47cdd! Whatever is merged first (and I believe
both can be merged), the other patch must be rebased then.

Change-Id: If8056135a212cf11017bce4c5fd08f83cd910d97
---
M includes/MobileFormatter.php
M includes/MobileFrontend.body.php
M includes/MobileFrontend.hooks.php
M includes/api/ApiMobileView.php
4 files changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/13/400413/1

diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index 938f90b..ea6a5fd 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -650,7 +650,7 @@
 *  {@see MobileFormatter::getHeadings}
 * @param array $transformOptions Options to pass when transforming 
content per section
 */
-   protected function makeSections( DOMDocument $doc, array $headings, 
$transformOptions ) {
+   protected function makeSections( DOMDocument $doc, array $headings, 
array $transformOptions ) {
// Find the parser output wrapper div
$xpath = new DOMXPath( $doc );
$containers = $xpath->query( 
'body/div[@class="mw-parser-output"][1]' );
diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index d2b059a..c3750c7 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -19,7 +19,7 @@
 * @param array $data The data to be recorded against the schema
 */
public static function eventLog( $schema, $revision, $data ) {
-   if ( is_callable( 'EventLogging::logEvent' ) ) {
+   if ( is_callable( [ EventLogging::class, 'logEvent' ] ) ) {
EventLogging::logEvent( $schema, $revision, $data );
}
}
@@ -132,7 +132,7 @@
 * @return mw.wikibase.entity|null
 */
public static function getWikibaseEntity( $item ) {
-   if ( !class_exists( 'Wikibase\\Client\\WikibaseClient' ) ) {
+   if ( !class_exists( WikibaseClient::class ) ) {
return null;
}
 
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 37636b8..4836e5a 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -905,7 +905,7 @@
self::registerMobileLoggingSchemasModule( $resourceLoader );
 
// add VisualEditor related modules only, if VisualEditor seems 
to be installed - T85007
-   if ( class_exists( 'VisualEditorHooks' ) ) {
+   if ( class_exists( \VisualEditorHooks::class ) ) {
$resourceLoader->register( [
'mobile.editor.ve' => $resourceBoilerplate + [
'dependencies' => [
@@ -1038,7 +1038,7 @@
$schemaMobileWebMainMenuClickTracking = 
$mfResourceFileModuleBoilerplate;
$schemaMobileWebSearch = $mfResourceFileModuleBoilerplate;
 
-   if ( class_exists( 'EventLogging' ) ) {
+   if ( class_exists( \EventLogging::class ) ) {
// schema.Edit is provided by WikimediaEvents
if ( $resourceLoader->isModuleRegistered( 'schema.Edit' 
) ) {
$schemaEdit += [
diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index c3380c9..51e3f47 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -248,7 +248,7 @@
// https://bugzilla.wikimedia.org/show_bug.cgi?id=51586
// Inform ppl if the page is infested with LiquidThreads but 
that's the
// only thing we support about it.
-   if ( class_exists( 'LqtDispatch' ) && LqtDispatch::isLqtPage( 
$title ) ) {
+   if ( class_exists( \LqtDispatch::class ) && 
\LqtDispatch::isLqtPage( $title ) ) {
$resultObj->addValue( null, $moduleName,
[ 'liquidthreads' => true ]
);
@@ -271,13 +271,13 @@
/**
 * Small wrapper around XAnalytics extension
 *
-* @see XAnalytics::addItem
+* @see \XAnalytics::addItem
 * @param string $name
 * @param string $value
   

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove superfluous documentation snippets

2017-12-27 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400412 )

Change subject: Remove superfluous documentation snippets
..

Remove superfluous documentation snippets

This patch mostly removes redundant stuff from lines like

@param ClassName $variableName ClassName object

where the later "ClassName object" does not add anything to what's
already entirely obvious from the ClassName and the $variableName
before.

Such documentation is worse than having no documentation, because one
must read it first to understand that it does not explain anything.

This patch makes room for future improvements.

Change-Id: I2f058e66a49fd42af49fdeb025235f92eea3ab9e
---
M includes/MobileContext.php
M includes/MobileFormatter.php
M includes/MobileFrontend.body.php
M includes/MobileFrontend.hooks.php
M includes/MobileFrontend.skin.hooks.php
M includes/api/ApiMobileView.php
M includes/content-providers/ContentProviderFactory.php
M includes/content-providers/DefaultContentProvider.php
M includes/content-providers/MwApiContentProvider.php
M includes/devices/DeviceDetector.php
M includes/devices/DeviceDetectorService.php
M includes/models/MobilePage.php
M includes/specials/SpecialMobileDiff.php
M includes/specials/SpecialMobileLanguages.php
M includes/specials/SpecialMobileWatchlist.php
M tests/phpunit/MobileFrontend.hooksTest.php
M tests/phpunit/api/ApiMobileViewTest.php
17 files changed, 42 insertions(+), 53 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/12/400412/1

diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index 070650d..d0b70da 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -818,7 +818,7 @@
 
/**
 * Take a URL and return a copy that removes any mobile tokens
-* @param string $url URL
+* @param string $url
 * @return string
 */
public function getDesktopUrl( $url ) {
@@ -1053,8 +1053,8 @@
 
/**
 * Add key/value pairs for analytics purposes to 
$this->analyticsLogItems
-* @param string $key Key
-* @param string $val Value
+* @param string $key
+* @param string $val
 */
public function addAnalyticsLogItem( $key, $val ) {
$key = trim( $key );
diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index 938f90b..481e322 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -71,8 +71,6 @@
const SHOW_FIRST_PARAGRAPH_BEFORE_INFOBOX = 
'showFirstParagraphBeforeInfobox';
 
/**
-* Constructor
-*
 * @param string $html Text to process
 * @param Title $title Title to which $html belongs
 */
@@ -94,7 +92,7 @@
/**
 * Creates and returns a MobileFormatter
 *
-* @param MobileContext $context MobileContext object
+* @param MobileContext $context
 * @param IContentProvider $provider ContentProvider interface
 * @param bool $enableSections (optional)
 *  whether to wrap the content of sections
@@ -645,8 +643,8 @@
 * that the section bodies are clearly defined (to be "expandable" for
 * example).
 *
-* @param DOMDocument $doc DOM document
-* @param DOMElement $headings The headings returned by
+* @param DOMDocument $doc
+* @param DOMElement[] $headings The headings returned by
 *  {@see MobileFormatter::getHeadings}
 * @param array $transformOptions Options to pass when transforming 
content per section
 */
@@ -780,7 +778,7 @@
 * FIXME: in-block isn't semantic in that it isn't
 * obviously connected to being editable.
 *
-* @param DOMElement $headings Heading elements
+* @param DOMElement[] $headings Heading elements
 */
protected function makeHeadingsEditable( array $headings ) {
foreach ( $headings as $heading ) {
diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index d2b059a..1c946d7 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -27,7 +27,7 @@
/**
 * Transforms content to be mobile friendly version.
 * Filters out various elements and runs the MobileFormatter.
-* @param OutputPage $out OutputPage object
+* @param OutputPage $out
 * @param string $text override out html
 *
 * @return string
@@ -94,7 +94,7 @@
/**
 * Generate user page content for non-existent user pages
 *
-* @param OutputPage $output OutputPage object
+* @param OutputPage $output
 * @param User $pageUser owner of the user page
 * @return string
 */
diff --git a/includes/MobileFrontend.hooks.php 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove PHPDoc block repeating the file name

2017-12-27 Thread Thiemo Kreuz (WMDE) (Code Review)
Thiemo Kreuz (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400410 )

Change subject: Remove PHPDoc block repeating the file name
..

Remove PHPDoc block repeating the file name

I can see these have been added in a commit that aimed to improve the
PHPDoc comments in this code base back in 2014, see Ib5a9507. However,
I do not see the point in literally repeating the name of the file that
contains a comment. I assume this was to work around a bug in a specific
documentation generation tool.

Change-Id: I821845436d8a4cf62a95707d8662e205602c8ff0
---
M includes/BaseDomainExtractorInterface.php
M includes/Minerva.hooks.php
M includes/MobileContext.php
M includes/MobileFormatter.php
M includes/MobileFrontend.body.php
M includes/MobileFrontend.hooks.php
M includes/MobileUI.php
M includes/WMFBaseDomainExtractor.php
M includes/api/ApiMobileView.php
M includes/api/ApiParseExtender.php
M includes/api/ApiWebappManifest.php
M includes/diff/InlineDiffFormatter.php
M includes/diff/InlineDifferenceEngine.php
M includes/models/MobileCollection.php
M includes/models/MobilePage.php
M includes/modules/MobileSiteModule.php
M includes/skins/MinervaTemplate.php
M includes/skins/SkinMinerva.php
M includes/specials/MobileSpecialPage.php
M includes/specials/MobileSpecialPageFeed.php
M includes/specials/SpecialMobileCite.php
M includes/specials/SpecialMobileContributions.php
M includes/specials/SpecialMobileDiff.php
M includes/specials/SpecialMobileEditWatchlist.php
M includes/specials/SpecialMobileEditor.php
M includes/specials/SpecialMobileHistory.php
M includes/specials/SpecialMobileLanguages.php
M includes/specials/SpecialMobileMenu.php
M includes/specials/SpecialMobileOptions.php
M includes/specials/SpecialMobileWatchlist.php
M includes/specials/SpecialNearby.php
M includes/specials/SpecialUploads.php
32 files changed, 3 insertions(+), 99 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/10/400410/1

diff --git a/includes/BaseDomainExtractorInterface.php 
b/includes/BaseDomainExtractorInterface.php
index 3b323e6..1ae7930 100644
--- a/includes/BaseDomainExtractorInterface.php
+++ b/includes/BaseDomainExtractorInterface.php
@@ -1,7 +1,5 @@
 https://gerrit.wikimedia.org/r/400410
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I821845436d8a4cf62a95707d8662e205602c8ff0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) 

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


  1   2   >