[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Replace kittens by boxes

2017-11-07 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389710 )

Change subject: Replace kittens by boxes
..

Replace kittens by boxes

Cause some langaues don't have kittens

Change-Id: Id292a54d6abea2e1e2888aa4614107776db5e23f
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AdvancedSearch 
refs/changes/10/389710/1

diff --git a/i18n/en.json b/i18n/en.json
index f734096..fc00682 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -33,7 +33,7 @@
"advancedsearch-help-filew": "Description: These 
fields allow you to specify the width of the file. Be aware of the 
following:  this is only applicable to file types that have width and 
height, like videos and images. Help 
page:[https://www.mediawiki.org/wiki/Help:CirrusSearch#File_measures 
Filemeasures] Syntax-Equivalent in the normal search:numbers 
with filew before them like filew:>800",
"advancedsearch-help-fileh": "Description: These 
fields allow you to specify the hieght of the file. Be aware of the 
following:  this is only applicable to file types that have width and 
height, like videos and images. Help 
page:[https://www.mediawiki.org/wiki/Help:CirrusSearch#File_measures 
Filemeasures] Syntax-Equivalent in the normal search:numbers 
with fileh before them like fileh:>600",
 
-   "advancedSearch-placeholder-commas": "Type words separated by comma 
e.g. cats, kittens, ...",
+   "advancedSearch-placeholder-commas": "Type words separated by comma 
e.g. cats, boxes, ...",
 
"advancedsearch-filetype-section-types": "General file type",
"advancedsearch-filetype-section-image": "Image format",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id292a54d6abea2e1e2888aa4614107776db5e23f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Added extra tests

2017-10-29 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387159 )

Change subject: Added extra tests
..

Added extra tests

https://phabricator.wikimedia.org/T173563

Change-Id: I9415a96b77ce16b4e0ddfeb1eeef4c53fccee9cc
---
M modules/ui/ext.advancedSearch.ArbitraryWordInput.js
M tests/qunit/ui/ArbitraryWordInput.test.js
2 files changed, 36 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AdvancedSearch 
refs/changes/59/387159/1

diff --git a/modules/ui/ext.advancedSearch.ArbitraryWordInput.js 
b/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
index e7a6305..c68fb4f 100644
--- a/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
+++ b/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
@@ -71,8 +71,10 @@
var self = this;
 
segments.map( function ( segment ) {
-   if ( self.isAllowedData( segment ) ) {
-   self.addTag( segment );
+   var trimmedSegment = segment.trim();
+
+   if ( self.isAllowedData( trimmedSegment ) ) {
+   self.addTag( trimmedSegment );
}
} );
 
diff --git a/tests/qunit/ui/ArbitraryWordInput.test.js 
b/tests/qunit/ui/ArbitraryWordInput.test.js
index 96d9eb4..27e4886 100644
--- a/tests/qunit/ui/ArbitraryWordInput.test.js
+++ b/tests/qunit/ui/ArbitraryWordInput.test.js
@@ -31,4 +31,36 @@
assert.equal( input.getTextForPlaceholder(), '' );
} );
 
+   function getTagsFromInput( inputText ) {
+   var input = new ArbitraryWordInput( new Model(), {} );
+   input.input.setValue( inputText );
+   input.buildTagsFromInput();
+
+   return input.getItems().map( function ( item ) {
+   return item.getData();
+   } );
+   }
+
+   QUnit.test( 'Text with commas gets turned into tags', function ( assert 
) {
+   assert.deepEqual(
+   getTagsFromInput( 'initial, comma separated, values' ),
+   [
+   'initial',
+   'comma separated',
+   'values'
+   ]
+   );
+   } );
+
+   QUnit.test( 'Extra commas do not cause empty tag creation', function ( 
assert ) {
+   assert.deepEqual(
+   getTagsFromInput( ',initial,, comma separated, 
values,,' ),
+   [
+   'initial',
+   'comma separated',
+   'values'
+   ]
+   );
+   } );
+
 }( mediaWiki ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9415a96b77ce16b4e0ddfeb1eeef4c53fccee9cc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Recalculate input size when placeholder is changed

2017-10-17 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384682 )

Change subject: Recalculate input size when placeholder is changed
..

Recalculate input size when placeholder is changed

Change-Id: I3feb95275f7709ef0720310b411809a1a5f685a2
---
M modules/ui/ext.advancedSearch.ArbitraryWordInput.js
1 file changed, 12 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AdvancedSearch 
refs/changes/82/384682/1

diff --git a/modules/ui/ext.advancedSearch.ArbitraryWordInput.js 
b/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
index abba980..d02d65b 100644
--- a/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
+++ b/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
@@ -25,7 +25,7 @@
$.extend( { allowArbitrary: true }, config || {} )
);
 
-   this.input.$input.on( 'input', this.onInput.bind( this ) );
+   this.input.$input.on( 'input', this.buildTagsFromInput.bind( 
this ) );
this.on( 'change', this.updatePlaceholder.bind( this ) );
 
this.populateFromStore();
@@ -59,7 +59,7 @@
this.populateFromStore();
};
 
-   mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.onInput = 
function () {
+   
mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.buildTagsFromInput = 
function () {
var segments = this.input.getValue().split( ',' );
 
if ( segments.length > 1 ) {
@@ -87,8 +87,17 @@
return 
mw.libs.advancedSearch.ui.ArbitraryWordInput.parent.prototype.isAllowedData.call(
 this, data );
};
 
+   mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.setPlaceholder = 
function ( placeholderText ) {
+   var currentText = this.input.$input.attr( 'placeholder' );
+
+   if ( currentText !== placeholderText ) {
+   this.contentWidthWithPlaceholder = undefined;
+   this.input.$input.attr( 'placeholder', placeholderText 
);
+   }
+   };
+

mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.updatePlaceholder = 
function () {
-   this.input.$input.attr( 'placeholder', 
this.getTextForPlaceholder() );
+   this.setPlaceholder( this.getTextForPlaceholder() );
};
 

mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.getTextForPlaceholder = 
function () {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3feb95275f7709ef0720310b411809a1a5f685a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Fixed placeholder text not showing properly

2017-10-12 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383968 )

Change subject: Fixed placeholder text not showing properly
..

Fixed placeholder text not showing properly

Fix provided by Fisch at
https://phabricator.wikimedia.org/T173563#3678825

Change-Id: I473bae3adadaa8d16ccb3c2a4ec0823f0126f127
---
M modules/ext.advancedSearch.css
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/modules/ext.advancedSearch.css b/modules/ext.advancedSearch.css
index 66e3a3f..cc90b5b 100644
--- a/modules/ext.advancedSearch.css
+++ b/modules/ext.advancedSearch.css
@@ -176,3 +176,7 @@
font-size: 110%;
color: #999;
 }
+
+.mw-advancedSearch-container input {
+   width:100%;
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I473bae3adadaa8d16ccb3c2a4ec0823f0126f127
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Automawtically mawk boxes when a comma is input

2017-10-12 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383789 )

Change subject: Automawtically mawk boxes when a comma is input
..

Automawtically mawk boxes when a comma is input

https://phabricator.wikimedia.org/T173563

Change-Id: I010110c6788b577824cdf27d41a8a033a97016e7
---
M modules/ui/ext.advancedSearch.ArbitraryWordInput.js
1 file changed, 56 insertions(+), 11 deletions(-)


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

diff --git a/modules/ui/ext.advancedSearch.ArbitraryWordInput.js 
b/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
index 5bcf076..abba980 100644
--- a/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
+++ b/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
@@ -16,6 +16,7 @@
mw.libs.advancedSearch.ui.ArbitraryWordInput = function ( store, config 
) {
this.store = store;
this.optionId = config.optionId;
+   this.placeholderText = config.placeholder || '';
 
this.store.connect( this, { update: 'onStoreUpdate' } );
 
@@ -24,26 +25,29 @@
$.extend( { allowArbitrary: true }, config || {} )
);
 
+   this.input.$input.on( 'input', this.onInput.bind( this ) );
+   this.on( 'change', this.updatePlaceholder.bind( this ) );
+
this.populateFromStore();
};
 
OO.inheritClass( mw.libs.advancedSearch.ui.ArbitraryWordInput, 
OO.ui.TagMultiselectWidget );
 
-   // TODO move to util module
-   function arrayEquals( a1, a2 ) {
-   var i = a1.length;
-   if ( a1.length !== a2.length ) {
-   return false;
-   }
-   while ( i-- ) {
-   if ( a1[ i ] !== a2[ i ] ) {
+   
mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.populateFromStore = 
function () {
+   // TODO move to util module
+   function arrayEquals( a1, a2 ) {
+   var i = a1.length;
+   if ( a1.length !== a2.length ) {
return false;
}
+   while ( i-- ) {
+   if ( a1[ i ] !== a2[ i ] ) {
+   return false;
+   }
+   }
+   return true;
}
-   return true;
-   }
 
-   
mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.populateFromStore = 
function () {
var val = this.store.getOption( this.optionId ) || [];
if ( arrayEquals( this.getValue(), val ) ) {
return;
@@ -55,6 +59,46 @@
this.populateFromStore();
};
 
+   mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.onInput = 
function () {
+   var segments = this.input.getValue().split( ',' );
+
+   if ( segments.length > 1 ) {
+   var self = this;
+
+   segments.map( function ( segment ) {
+   if ( self.isAllowedData( segment ) ) {
+   self.addTag( segment );
+   }
+   } );
+
+   this.clearInput();
+   this.focus();
+   }
+   };
+
+   /**
+* @inheritdoc
+*/
+   mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.isAllowedData = 
function ( data ) {
+   if ( data.trim() === '' ) {
+   return false;
+   }
+
+   return 
mw.libs.advancedSearch.ui.ArbitraryWordInput.parent.prototype.isAllowedData.call(
 this, data );
+   };
+
+   
mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.updatePlaceholder = 
function () {
+   this.input.$input.attr( 'placeholder', 
this.getTextForPlaceholder() );
+   };
+
+   
mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.getTextForPlaceholder = 
function () {
+   if ( this.input.getValue() !== '' || this.getValue().length > 0 
) {
+   return '';
+   }
+
+   return this.placeholderText;
+   };
+
/**
 * @inheritdoc
 */
@@ -62,6 +106,7 @@
if ( !this.input.getValue() ) {
return true;
}
+
return 
mw.libs.advancedSearch.ui.ArbitraryWordInput.parent.prototype.doInputEnter.call(
 this );
};
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I010110c6788b577824cdf27d41a8a033a97016e7
Gerrit-PatchSet: 1
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: CS changes in ArbitraryWordInput

2017-10-12 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383775 )

Change subject: CS changes in ArbitraryWordInput
..

CS changes in ArbitraryWordInput

Change-Id: I0ac61f36e52f86570dde32be6112a9c39616b8ee
---
M modules/ui/ext.advancedSearch.ArbitraryWordInput.js
1 file changed, 16 insertions(+), 14 deletions(-)


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

diff --git a/modules/ui/ext.advancedSearch.ArbitraryWordInput.js 
b/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
index caca982..41b8ff2 100644
--- a/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
+++ b/modules/ui/ext.advancedSearch.ArbitraryWordInput.js
@@ -14,18 +14,32 @@
 * @param  {Object} config
 */
mw.libs.advancedSearch.ui.ArbitraryWordInput = function ( store, config 
) {
-   var myConfig = $.extend( { allowArbitrary: true }, config || {} 
);
this.store = store;
this.optionId = config.optionId;
 
this.store.connect( this, { update: 'onStoreUpdate' } );
 
-   mw.libs.advancedSearch.ui.ArbitraryWordInput.parent.call( this, 
myConfig );
+   mw.libs.advancedSearch.ui.ArbitraryWordInput.parent.call(
+   this,
+   $.extend( { allowArbitrary: true }, config || {} )
+   );
 
this.populateFromStore();
};
 
OO.inheritClass( mw.libs.advancedSearch.ui.ArbitraryWordInput, 
OO.ui.TagMultiselectWidget );
+
+   
mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.populateFromStore = 
function () {
+   var val = this.store.getOption( this.optionId ) || [];
+   if ( arrayEquals( this.getValue(), val ) ) {
+   return;
+   }
+   this.setValue( val );
+   };
+
+   mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.onStoreUpdate = 
function () {
+   this.populateFromStore();
+   };
 
/**
 * @inheritdoc
@@ -60,17 +74,5 @@
}
return true;
}
-
-   mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.onStoreUpdate = 
function () {
-   this.populateFromStore();
-   };
-
-   
mw.libs.advancedSearch.ui.ArbitraryWordInput.prototype.populateFromStore = 
function () {
-   var val = this.store.getOption( this.optionId ) || [];
-   if ( arrayEquals( this.getValue(), val ) ) {
-   return;
-   }
-   this.setValue( val );
-   };
 
 }( mediaWiki, jQuery ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ac61f36e52f86570dde32be6112a9c39616b8ee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Add placeholder text for comma fields

2017-10-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383772 )

Change subject: Add placeholder text for comma fields
..

Add placeholder text for comma fields

https://phabricator.wikimedia.org/T173563

Change-Id: Id393b25d6d61846e1f37d4b05148c3dd5c7b2a3b
---
M i18n/en.json
M i18n/qqq.json
M modules/ext.advancedSearch.init.js
3 files changed, 13 insertions(+), 2 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index 9528bdf..9106ea2 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -35,6 +35,8 @@
"advancedsearch-help-filew": "Description: These 
fields allow you to specify the width of the file. Be aware of the 
following:  this is only applicable to file types that have width and 
height, like videos and images. Help 
page:[https://www.mediawiki.org/wiki/Help:CirrusSearch#File_measures 
Filemeasures] Syntax-Equivalent in the normal search:numbers 
with filew before them like filew:>800",
"advancedsearch-help-fileh": "Description: These 
fields allow you to specify the hieght of the file. Be aware of the 
following:  this is only applicable to file types that have width and 
height, like videos and images. Help 
page:[https://www.mediawiki.org/wiki/Help:CirrusSearch#File_measures 
Filemeasures] Syntax-Equivalent in the normal search:numbers 
with fileh before them like fileh:>600",
 
+   "advancedSearch-placeholder-commas": "Type words separated by comma 
e.g. cats, kittens, ...",
+
"advancedsearch-filetype-section-types": "General file type",
"advancedsearch-filetype-section-image": "Image format",
"advancedsearch-filetype-section-video": "Video format",
@@ -53,9 +55,11 @@
"advancedSearch-filesize-greater-than-symbol": ">",
"advancedSearch-filesize-smaller-than": "lower than",
"advancedSearch-filesize-smaller-than-symbol": "<",
+
"advancedSearch-namespaces-articles": "Articles",
"advancedSearch-namespaces-search-in": "Search in:",
"advancedSearch-namespaces-preset-all": "All",
+
"advancedSearch-beta-feature-message": "Advanced Search Interface",
"advancedSearch-beta-feature-description": "Easy access to advanced 
search capabilities on [[Special:Search]]."
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a25c837..fa8b844 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -34,6 +34,7 @@
"advancedsearch-help-filetype": "Help text shown in a dialog for the 
field for file type",
"advancedsearch-help-filew": "Help text shown in a dialog for the field 
for file width in pixels",
"advancedsearch-help-fileh": "Help text shown in a dialog for the field 
for file height in pixels",
+   "advancedSearch-placeholder-commas": "Placeholder text shown in fields 
that accept multiple values separated by commas",
"advancedsearch-filetype-section-types": "Label for the file type 
section",
"advancedsearch-filetype-section-image": "Label for the image format 
section",
"advancedsearch-filetype-section-video": "Label for the video format 
section",
diff --git a/modules/ext.advancedSearch.init.js 
b/modules/ext.advancedSearch.init.js
index 63f83fe..2cce22c 100644
--- a/modules/ext.advancedSearch.init.js
+++ b/modules/ext.advancedSearch.init.js
@@ -156,7 +156,10 @@
init: function () {
return new 
mw.libs.advancedSearch.ui.ArbitraryWordInput(
state,
-   { optionId: 'phrase' }
+   {
+   optionId: 'phrase',
+   placeholder: mw.msg( 
'advancedSearch-placeholder-commas' )
+   }
);
}
},
@@ -181,7 +184,10 @@
init: function () {
return new 
mw.libs.advancedSearch.ui.ArbitraryWordInput(
state,
-   { optionId: 'or' }
+   {
+   optionId: 'or',
+   placeholder: mw.msg( 
'advancedSearch-placeholder-commas' )
+   }
);
}
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id393b25d6d61846e1f37d4b05148c3dd5c7b2a3b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Remove dead placeholder code

2017-10-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383771 )

Change subject: Remove dead placeholder code
..

Remove dead placeholder code

Dead as far as I can tell...

Change-Id: I7181c68249591197689b7388402495a39465d8fb
---
M modules/ext.advancedSearch.init.js
1 file changed, 0 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AdvancedSearch 
refs/changes/71/383771/1

diff --git a/modules/ext.advancedSearch.init.js 
b/modules/ext.advancedSearch.init.js
index 48a4291..1f01c17 100644
--- a/modules/ext.advancedSearch.init.js
+++ b/modules/ext.advancedSearch.init.js
@@ -138,7 +138,6 @@
{
group: 'text',
id: 'plain',
-   placeholder: '…',
formatter: function ( val ) {
return val;
}
@@ -146,7 +145,6 @@
{
group: 'text',
id: 'phrase',
-   placeholder: '"…"',
formatter: function ( val ) {
if ( Array.isArray( val ) ) {
return $.map( val, enforceQuotes 
).join( ' ' );
@@ -163,7 +161,6 @@
{
group: 'text',
id: 'not',
-   placeholder: '-…',
formatter: function ( val ) {
return '-' + optionalQuotes( val );
}
@@ -171,7 +168,6 @@
{
group: 'text',
id: 'or',
-   placeholder: '…OR',
formatter: function ( val ) {
if ( Array.isArray( val ) ) {
return $.map( val, optionalQuotes 
).join( ' OR ' );
@@ -189,7 +185,6 @@
{
group: 'structure',
id: 'intitle',
-   placeholder: 'intitle:…',
formatter: function ( val ) {
return 'intitle:' + optionalQuotes( val );
}
@@ -198,7 +193,6 @@
{
group: 'structure',
id: 'hastemplate',
-   placeholder: 'hastemplate:…',
formatter: function ( val ) {
if ( Array.isArray( val ) ) {
return $.map( val, function ( 
templateItem ) {
@@ -218,7 +212,6 @@
{
group: 'structure',
id: 'insource',
-   placeholder: 'insource:…',
formatter: function ( val ) {
return 'insource:' + ( /^\/.*\/$/.test( val ) ? 
val : optionalQuotes( val ) );
}
@@ -230,7 +223,6 @@
{
group: 'files',
id: 'filetype',
-   placeholder: 'filetype:…',
formatter: function ( val ) {
switch ( val ) {
 
@@ -261,7 +253,6 @@
{
group: 'files',
id: 'filew',
-   placeholder: 'filew:…',
formatter: function ( val ) {
return formatSizeConstraint( 'filew:', val );
},
@@ -279,7 +270,6 @@
{
group: 'files',
id: 'fileh',
-   placeholder: 'fileh:…',
formatter: function ( val ) {
return formatSizeConstraint( 'fileh:', val );
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7181c68249591197689b7388402495a39465d8fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Extract new code into dedicated method

2017-10-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383046 )

Change subject: Extract new code into dedicated method
..

Extract new code into dedicated method

Follow up to https://gerrit.wikimedia.org/r/#/c/382703/

Change-Id: I1f80af893db2a2376e0a9a6913806c018b80e2be
---
M modules/ui/ext.advancedSearch.NamespaceFilters.js
1 file changed, 11 insertions(+), 7 deletions(-)


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

diff --git a/modules/ui/ext.advancedSearch.NamespaceFilters.js 
b/modules/ui/ext.advancedSearch.NamespaceFilters.js
index 79b7282..c0a21f3 100644
--- a/modules/ui/ext.advancedSearch.NamespaceFilters.js
+++ b/modules/ui/ext.advancedSearch.NamespaceFilters.js
@@ -163,21 +163,25 @@
} );
};
 
+   
mw.libs.advancedSearch.ui.NamespaceFilters.prototype.disableSelectedNamespacesInMenu
 = function () {
+   var self = this;
+
+   $.each( this.getMenu().getItems(), function ( index, menuItem ) 
{
+   menuItem.setDisabled( !!self.getItemFromData( 
menuItem.getData() ) );
+   } );
+   };
+
/**
 * Respond to change event, where items were added, removed, or cleared.
 *
 * Overrides OO.ui.TagMultiselectWidget.prototype.onChangeTags default 
behaviour to add GUI effect
 */
mw.libs.advancedSearch.ui.NamespaceFilters.prototype.onChangeTags = 
function () {
-   var self = this,
-   tagItems = this.getItems(),
-   menuItems = this.getMenu().getItems();
-

mw.libs.advancedSearch.ui.NamespaceFilters.parent.prototype.onChangeTags.call( 
this );
 
-   $.each( menuItems, function ( index, menuItem ) {
-   menuItem.setDisabled( !!self.getItemFromData( 
menuItem.getData() ) );
-   } );
+   this.disableSelectedNamespacesInMenu();
+
+   var tagItems = this.getItems();
 
if ( tagItems.length > 0 ) {
tagItems[ 0 ].setDisabled( tagItems.length === 1 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f80af893db2a2376e0a9a6913806c018b80e2be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Use variable already in scope

2017-10-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383045 )

Change subject: Use variable already in scope
..

Use variable already in scope

Change-Id: Ieab09680b5ae509b2d6e77086809c1f9eb82ad48
---
M modules/dm/ext.advancedSearch.SearchModel.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/dm/ext.advancedSearch.SearchModel.js 
b/modules/dm/ext.advancedSearch.SearchModel.js
index 7db542b..a7af335 100644
--- a/modules/dm/ext.advancedSearch.SearchModel.js
+++ b/modules/dm/ext.advancedSearch.SearchModel.js
@@ -194,7 +194,7 @@
if ( !fileType ) {
return false;
}
-   var generalFileType = this.getOption( 'filetype' ).replace( 
/\/.*/, '' );
+   var generalFileType = fileType.replace( /\/.*/, '' );
return FILETYPES_WITH_DIMENSIONS.indexOf( generalFileType ) !== 
-1;
};
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieab09680b5ae509b2d6e77086809c1f9eb82ad48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Pass RTL config to the widgets

2017-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381522 )

Change subject: Pass RTL config to the widgets
..

Pass RTL config to the widgets

This is for https://phabricator.wikimedia.org/T175826

Does not work for the ArbitraryWordInput widgets yet. There appears to be a bug
in OO JS UI here. We are passing the info in the config. Presumably the
TagMultiselectWidget does not pass it to the right bunch of mixed in code.

Yay for rampant inheritance/mixing that makes finding stuff ulrta derp. And
bonus points for all the widegst in one file, which makes searching in a scope
so much easier.

Change-Id: I6c889e519474e96dcc6f89e6979a72a811a2c9c5
---
M AdvancedSearch.hooks.php
M modules/ext.advancedSearch.init.js
M modules/ui/ext.advancedSearch.ImageDimensionInput.js
3 files changed, 29 insertions(+), 19 deletions(-)


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

diff --git a/AdvancedSearch.hooks.php b/AdvancedSearch.hooks.php
index eb2146d..41b097c 100644
--- a/AdvancedSearch.hooks.php
+++ b/AdvancedSearch.hooks.php
@@ -36,7 +36,16 @@
( new MimeTypeConfigurator( 
MediaWikiServices::getInstance()->getMimeAnalyzer() ) )
->getMimeTypes( 
$special->getConfig()->get( 'FileExtensions' ) )
);
-   $special->getOutput()->addJsConfigVars( 
'advancedSearch.tooltips', TooltipGenerator::generateToolTips() );
+
+   $special->getOutput()->addJsConfigVars(
+   'advancedSearch.tooltips',
+   TooltipGenerator::generateToolTips()
+   );
+
+   $special->getOutput()->addJsConfigVars(
+   'advancedSearch.languageDirection',
+   $special->getLanguage()->getDir()
+   );
}
}
 
diff --git a/modules/ext.advancedSearch.init.js 
b/modules/ext.advancedSearch.init.js
index 48a4291..cab21dd 100644
--- a/modules/ext.advancedSearch.init.js
+++ b/modules/ext.advancedSearch.init.js
@@ -156,7 +156,7 @@
init: function () {
return new 
mw.libs.advancedSearch.ui.ArbitraryWordInput(
state,
-   { optionId: 'phrase' }
+   newWidgetConfig( 'phrase' )
);
}
},
@@ -181,7 +181,7 @@
init: function () {
return new 
mw.libs.advancedSearch.ui.ArbitraryWordInput(
state,
-   { optionId: 'or' }
+   newWidgetConfig( 'or' )
);
}
},
@@ -210,7 +210,7 @@
init: function () {
return new 
mw.libs.advancedSearch.ui.TemplateSearch(
state,
-   { optionId: 'hastemplate' }
+   newWidgetConfig( 'hastemplate' )
);
},
customEventHandling: true
@@ -250,10 +250,7 @@
return new 
mw.libs.advancedSearch.ui.FileTypeSelection(
state,
new 
mw.libs.advancedSearch.dm.FileTypeOptionProvider( mw.config.get( 
'advancedSearch.mimeTypes' ) ),
-   {
-   optionId: 'filetype',
-   name: 
'advancedSearchOption-filetype'
-   }
+   newWidgetConfig( 'filetype' )
);
},
requiredNamespace: 6
@@ -269,9 +266,7 @@
init: function () {
return new 
mw.libs.advancedSearch.ui.ImageDimensionInput(
state,
-   {
-   optionId: 'filew'
-   }
+   newWidgetConfig( 'filew' )
);
},
layout: createOptionalFieldLayout
@@ -287,9 +282,7 @@
init: function () {
return new 
mw.libs.advancedSearch.ui.ImageDimensionInput(
state,

[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Added a small note on QUnit to README

2017-09-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375947 )

Change subject: Added a small note on QUnit to README
..

Added a small note on QUnit to README

Change-Id: I5efc4f8f0769386c7a239c1b8d1590d079ec59b8
---
M README.md
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AdvancedSearch 
refs/changes/47/375947/1

diff --git a/README.md b/README.md
index 6251622..21e4a7e 100644
--- a/README.md
+++ b/README.md
@@ -25,3 +25,9 @@
 ### Run Linting
 
 docker-compose run --rm js-build grunt
+
+### Running the QUnit tests
+
+Run MediaWiki and then hit this page in your browser:
+
+
index.php?title=Special%3AJavaScriptTest%2Fqunit%2Fplain=ext.advancedSearch
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5efc4f8f0769386c7a239c1b8d1590d079ec59b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Add help messages

2017-09-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375946 )

Change subject: Add help messages
..

Add help messages

https://phabricator.wikimedia.org/T168405

Change-Id: I34efbd375cf90d3d2e58f3025968fff2c31cd968
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/ext.advancedSearch.init.js
4 files changed, 44 insertions(+), 5 deletions(-)


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

diff --git a/extension.json b/extension.json
index 1056264..4247c6c 100644
--- a/extension.json
+++ b/extension.json
@@ -66,7 +66,16 @@
"advancedsearch-field-insource",
"advancedsearch-field-filetype",
"advancedsearch-field-filew",
-   "advancedsearch-field-fileh"
+   "advancedsearch-field-fileh",
+   "advancedsearch-help-plain",
+   "advancedsearch-help-phrase",
+   "advancedsearch-help-or",
+   "advancedsearch-help-not",
+   "advancedsearch-help-hastemplate",
+   "advancedsearch-help-insource",
+   "advancedsearch-help-filetype",
+   "advancedsearch-help-filew",
+   "advancedsearch-help-fileh"
],
"dependencies": [
"mediawiki.util",
diff --git a/i18n/en.json b/i18n/en.json
index a19fca4..03ba2e2 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -24,6 +24,16 @@
"advancedsearch-field-filew": "File width in pixels:",
"advancedsearch-field-fileh": "File height in pixels:",
 
+   "advancedsearch-help-plain": "searches for these words in the title or 
text.",
+   "advancedsearch-help-phrase": "searches for a specific sequence of 
characters. Punctuation marks are ignored.",
+   "advancedsearch-help-or": "excludes pages containing these words from 
the search.",
+   "advancedsearch-help-not": "at least one of the search terms has to be 
included in the page.",
+   "advancedsearch-help-hastemplate": "searches for pages that contain 
exactly this template.",
+   "advancedsearch-help-insource": "only looks for the search term in the 
source code.",
+   "advancedsearch-help-filetype": "searches only for files of the 
selected type",
+   "advancedsearch-help-filew": "searches only for files with the 
specified width",
+   "advancedsearch-help-fileh": "searches only for files with the 
specified height",
+
"advancedsearch-filetype-section-types": "General file type",
"advancedsearch-filetype-section-image": "Image format",
"advancedsearch-filetype-section-video": "Video format",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 25c12be..dbbbd8b 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -23,6 +23,15 @@
"advancedsearch-field-filetype": "Label for the field for file 
type\n{{Identical|File type}}",
"advancedsearch-field-filew": "Label for the field for file width in 
pixels",
"advancedsearch-field-fileh": "Label for the field for file height in 
pixels",
+   "advancedsearch-help-plain": "Help text shown in a dialog for the field 
for plain search",
+   "advancedsearch-help-phrase": "Help text shown in a dialog for the 
field for exact search",
+   "advancedsearch-help-or": "Help text shown in a dialog for the field 
for or search",
+   "advancedsearch-help-not": "Help text shown in a dialog for the field 
for excluded words in search",
+   "advancedsearch-help-hastemplate": "Help text shown in a dialog for the 
field for for searching pages with a template",
+   "advancedsearch-help-insource": "Help text shown in a dialog for the 
field for wikitext search",
+   "advancedsearch-help-filetype": "Help text shown in a dialog for the 
field for file type\n{{Identical|File type}}",
+   "advancedsearch-help-filew": "Help text shown in a dialog for the field 
for file width in pixels",
+   "advancedsearch-help-fileh": "Help text shown in a dialog for the field 
for file height in pixels",
"advancedsearch-filetype-section-types": "Label for the file type 
section",
"advancedsearch-filetype-section-image": "Label for the image format 
section",
"advancedsearch-filetype-section-video": "Label for the video format 
section",
diff --git a/modules/ext.advancedSearch.init.js 
b/modules/ext.advancedSearch.init.js
index 284d02a..01cefb5 100644
--- a/modules/ext.advancedSearch.init.js
+++ b/modules/ext.advancedSearch.init.js
@@ -90,6 +90,15 @@
};
}
 
+   function getMessageOrFalse( messageKey ) {
+   var 

[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Extracted functions in form initialization code

2017-09-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375944 )

Change subject: Extracted functions in form initialization code
..

Extracted functions in form initialization code

Change-Id: Ida21865af65d88919879097876e861a97a537635
---
M modules/ext.advancedSearch.init.js
1 file changed, 31 insertions(+), 19 deletions(-)


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

diff --git a/modules/ext.advancedSearch.init.js 
b/modules/ext.advancedSearch.init.js
index b4a2def..0cf538b 100644
--- a/modules/ext.advancedSearch.init.js
+++ b/modules/ext.advancedSearch.init.js
@@ -340,20 +340,41 @@
 
$searchField.val( mw.util.getParamValue( 
'advancedSearchOption-original' ) );
 
+   function createWidget( option ) {
+var initializationFunction = option.init ||
+   function () {
+return new mw.libs.advancedSearch.ui.TextInput(
+   state,
+   {
+   id: 'advancedSearchOption-' + 
option.id,
+   optionId: option.id
+   }
+   );
+};
+
+   return initializationFunction();
+   }
+
+   function createLayout( option, widget ) {
+if ( option.layout ) {
+return option.layout( widget, option );
+}
+
+return new OO.ui.FieldLayout(
+   widget,
+   {
+   label: mw.msg( 'advancedsearch-field-' + 
option.id ),
+   align: 'right'
+   }
+   );
+   }
+
advancedOptions.forEach( function ( option ) {
if ( option.enabled && !option.enabled() ) {
return;
}
 
-   var paramName = 'advancedSearchOption-' + option.id;
-
-   var widgetInit = option.init || function () {
-   return new mw.libs.advancedSearch.ui.TextInput( 
state, {
-   id: paramName,
-   optionId: option.id
-   } );
-   },
-   widget = widgetInit();
+   var widget = createWidget( option );
 
if ( !option.customEventHandling ) {
widget.on( 'change', createMultiSelectChangeHandler( 
option.id ) );
@@ -365,16 +386,7 @@
} );
}
 
-   var layout;
-   if ( option.layout ) {
-   layout = option.layout( widget, option );
-   } else {
-   layout = new OO.ui.FieldLayout( widget, {
-   label: mw.msg( 'advancedsearch-field-' + 
option.id ),
-   align: 'right'
-   } );
-   }
-   optionSets[ option.group ].addItems( [ layout ] );
+   optionSets[ option.group ].addItems( [ createLayout( option, 
widget ) ] );
} );
 
var $allOptions = $( '' ).prop( { 'class': 
'mw-advancedSearch-fieldContainer' } );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida21865af65d88919879097876e861a97a537635
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Inline not neede var

2017-08-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370208 )

Change subject: Inline not neede var
..

Inline not neede var

Change-Id: Id6b76b741d9bd24fa4dc15e70ceb04a93bead166
---
M modules/ext.advancedSearch.init.js
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/modules/ext.advancedSearch.init.js 
b/modules/ext.advancedSearch.init.js
index 8392d67..b009496 100644
--- a/modules/ext.advancedSearch.init.js
+++ b/modules/ext.advancedSearch.init.js
@@ -144,11 +144,10 @@
return enforceQuotes( val );
},
init: function () {
-   var widget = new 
mw.libs.advancedSearch.ui.ArbitraryWordInput(
+return new mw.libs.advancedSearch.ui.ArbitraryWordInput(
state,
{ optionId: 'phrase' }
);
-   return widget;
}
},
{

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6b76b741d9bd24fa4dc15e70ceb04a93bead166
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: T171843: Remove fields for category search and for prefix se...

2017-08-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370207 )

Change subject: T171843: Remove fields for category search and for prefix search
..

T171843: Remove fields for category search and for prefix search

Change-Id: I043fc44cc23a04e136153e391b70b4b851e28aa0
---
M modules/ext.advancedSearch.init.js
M package-lock.json
2 files changed, 1,035 insertions(+), 202 deletions(-)


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

diff --git a/modules/ext.advancedSearch.init.js 
b/modules/ext.advancedSearch.init.js
index 8392d67..5b584eb 100644
--- a/modules/ext.advancedSearch.init.js
+++ b/modules/ext.advancedSearch.init.js
@@ -178,33 +178,12 @@
}
},
 
-   // Structure
-   {
-   group: 'structure',
-   id: 'subpage',
-   placeholder: 'prefix:…',
-   formatter: function ( val ) {
-   return 'prefix:' + val;
-   },
-   greedy: true
-   },
{
group: 'structure',
id: 'intitle',
placeholder: 'intitle:…',
formatter: function ( val ) {
return 'intitle:' + optionalQuotes( val );
-   }
-   },
-   {
-   group: 'structure',
-   id: 'deepcat',
-   placeholder: 'deepcat:…',
-   /* enabled: function () {
-return !!mw.libs.deepCat;
-}, */
-   formatter: function ( val ) {
-   return 'deepcat:' + optionalQuotes( val );
}
},
 
@@ -237,27 +216,6 @@
return 'insource:' + ( /^\/.*\/$/.test( val ) ? 
val : optionalQuotes( val ) );
}
},
-
-   /*
-   {
-   group: 'categories',
-   id: 'deepcat2',
-   placeholder: 'deepcat:…',
-   /* enabled: function () {
-return !!mw.libs.deepCat;
-},
-   formatter: function ( val ) {
-   return 'deepcat:' + optionalQuotes( val );
-   }
-   },
-   {
-   group: 'categories',
-   id: 'incategory',
-   placeholder: 'incategory:…',
-   formatter: function ( val ) {
-   return 'incategory:' + optionalQuotes( val );
-   }
-   }, */
 
// Files
// filebits:…
@@ -344,15 +302,6 @@
},
layout: createOptionalFieldLayout
}
-   /* {
-   group: 'files',
-   id: 'fileres',
-   placeholder: 'fileres:…',
-   formatter: function ( val ) {
-   return 'fileres:' + formatSizeConstraint( val );
-   },
-   requiredNamespace: 6
-   } */
 
// Ordering
// prefer-recent:…
diff --git a/package-lock.json b/package-lock.json
index 1aed77c..6cc7486 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,4 +1,5 @@
 {
+   "requires": true,
"lockfileVersion": 1,
"dependencies": {
"abbrev": {
@@ -18,6 +19,9 @@
"resolved": 
"https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz;,
"integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=",
"dev": true,
+   "requires": {
+   "acorn": "3.3.0"
+   },
"dependencies": {
"acorn": {
"version": "3.3.0",
@@ -31,7 +35,11 @@
"version": "4.11.8",
"resolved": 
"https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz;,
"integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=",
-   "dev": true
+   "dev": true,
+   "requires": {
+   "co": "4.6.0",
+   "json-stable-stringify": "1.0.1"
+   }
},
"ajv-keywords": {
"version": "1.5.1",
@@ -67,13 +75,19 @@

[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Do not require specific versions of PHPCS

2017-01-19 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333123 )

Change subject: Do not require specific versions of PHPCS
..

Do not require specific versions of PHPCS

We keep running into MW codesniffer requiring a specific old version
under the lowerbound of our version range in the WMDE fundraising
software. There is no need for this really.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/23/333123/1

diff --git a/composer.json b/composer.json
index 8ad51c3..85842e0 100644
--- a/composer.json
+++ b/composer.json
@@ -6,7 +6,7 @@
"license": "GPL-2.0+",
"require": {
"php": ">= 5.5.9",
-   "squizlabs/php_codesniffer": "2.7.1"
+   "squizlabs/php_codesniffer": "^2.7.1"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.*",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a6a05912dbe8e5c18e2d006fc39036f41a65936
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Make if predicates more explicit

2017-01-06 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331104 )

Change subject: Make if predicates more explicit
..

Make if predicates more explicit

Change-Id: I8f0b80475d265e6ad7a3c625c2fa0d2cb569f378
---
M repo/includes/Hooks/InfoActionHookHandler.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/repo/includes/Hooks/InfoActionHookHandler.php 
b/repo/includes/Hooks/InfoActionHookHandler.php
index f3e5cae..6bec9d1 100644
--- a/repo/includes/Hooks/InfoActionHookHandler.php
+++ b/repo/includes/Hooks/InfoActionHookHandler.php
@@ -125,12 +125,12 @@
 */
private function formatSubscription( $subscription, Title $title ) {
$site = $this->siteLookup->getSite( $subscription );
-   if ( !$site ) {
+   if ( $site === null ) {
return $subscription;
}
 
$url = $site->getPageUrl( 'Special:EntityUsage/' . 
$title->getText() );
-   if ( !$url ) {
+   if ( $url === false ) {
return $subscription;
}
$element = Html::element( 'a',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f0b80475d265e6ad7a3c625c2fa0d2cb569f378
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Inlined return var

2017-01-06 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331103 )

Change subject: Inlined return var
..

Inlined return var

Change-Id: I6d9d79fd2d8592acf7f8f65457f0fad5585ce912
---
M repo/includes/Hooks/InfoActionHookHandler.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/repo/includes/Hooks/InfoActionHookHandler.php 
b/repo/includes/Hooks/InfoActionHookHandler.php
index f3e5cae..5788642 100644
--- a/repo/includes/Hooks/InfoActionHookHandler.php
+++ b/repo/includes/Hooks/InfoActionHookHandler.php
@@ -133,11 +133,11 @@
if ( !$url ) {
return $subscription;
}
-   $element = Html::element( 'a',
+
+   return Html::element( 'a',
[ 'href' => $url ],
$subscription
);
-   return $element;
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d9d79fd2d8592acf7f8f65457f0fad5585ce912
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Simplified if-else

2017-01-06 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331102 )

Change subject: Simplified if-else
..

Simplified if-else

Change-Id: Ic20984d51392b35a96cbfb6fb53ef028cffc3472
---
M repo/includes/Hooks/InfoActionHookHandler.php
1 file changed, 4 insertions(+), 3 deletions(-)


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

diff --git a/repo/includes/Hooks/InfoActionHookHandler.php 
b/repo/includes/Hooks/InfoActionHookHandler.php
index f3e5cae..7305b20 100644
--- a/repo/includes/Hooks/InfoActionHookHandler.php
+++ b/repo/includes/Hooks/InfoActionHookHandler.php
@@ -82,11 +82,12 @@
private function getPageInfoRow( Title $title ) {
$entity = $this->entityIdLookup->getEntityIdForTitle( $title );
$subscriptions = $this->subscriptionLookup->getSubscribers( 
$entity );
-   if ( !$subscriptions ) {
-   return $this->getNoSubscriptionText();
-   } else {
+
+   if ( $subscriptions ) {
return $this->formatSubscriptions( $subscriptions, 
$title );
}
+
+   return $this->getNoSubscriptionText();
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic20984d51392b35a96cbfb6fb53ef028cffc3472
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Removed TODO

2017-01-06 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331101 )

Change subject: Removed TODO
..

Removed TODO

Change-Id: I42488d6470ac4aa7e350c294c20101eec122215f
---
M repo/includes/Disposable.php
1 file changed, 0 insertions(+), 2 deletions(-)


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

diff --git a/repo/includes/Disposable.php b/repo/includes/Disposable.php
index 4639f45..68ba26f 100644
--- a/repo/includes/Disposable.php
+++ b/repo/includes/Disposable.php
@@ -7,8 +7,6 @@
  *
  * @license GPL-2.0+
  * @author Daniel Kinzler
- *
- * @todo make this reusable outside Wikibase
  */
 interface Disposable {
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42488d6470ac4aa7e350c294c20101eec122215f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Added Maps extension role

2016-11-06 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/320158

Change subject: Added Maps extension role
..

Added Maps extension role

Change-Id: I0db27c4544e111dffdbbfd0553573398b064582f
---
A puppet/modules/role/manifests/maps.pp
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/58/320158/1

diff --git a/puppet/modules/role/manifests/maps.pp 
b/puppet/modules/role/manifests/maps.pp
new file mode 100644
index 000..bd7e002
--- /dev/null
+++ b/puppet/modules/role/manifests/maps.pp
@@ -0,0 +1,11 @@
+# == Class: role::maps
+# Adds various mapping features to MediaWiki
+class role::maps {
+
+require ::role::mediawiki
+
+mediawiki::composer::require { 'Maps':
+package => 'mediawiki/maps',
+version => '*'
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0db27c4544e111dffdbbfd0553573398b064582f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Removed dead code

2016-09-01 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/308120

Change subject: Removed dead code
..

Removed dead code

Change-Id: Iac8b6a59b5cf91e5c69d20a5825a50663273ab85
---
M repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php
1 file changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php 
b/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php
index 7afffea..11fe688 100644
--- a/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php
+++ b/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php
@@ -62,7 +62,7 @@
return $array;
}
 
-   private function removePageInfoAttributes( array $result, $entityId = 
null ) {
+   private function removePageInfoAttributes( array $result ) {
$attributesToRemove = array( 'pageid', 'lastrevid', 'modified', 
'title', 'ns' );
 
foreach ( $attributesToRemove as $attributeToRemove ) {
@@ -107,7 +107,7 @@
 
$module = $this->getApiModule( GetEntities::class, 
'wbgetentities', $params );
$result = $this->executeApiModule( $module );
-   $actual = $this->removePageInfoAttributes( $result, $entityId );
+   $actual = $this->removePageInfoAttributes( $result );
 
$this->assertEquals( $this->getExpectedJson( 'getentities' ), 
$actual );
}
@@ -125,7 +125,7 @@
 
$module = $this->getApiModule( SetLabel::class, 'wbsetlabel', 
$params, true );
$result = $this->executeApiModule( $module );
-   $actual = $this->removePageInfoAttributes( $result, $entityId );
+   $actual = $this->removePageInfoAttributes( $result );
 
$this->assertEquals( $this->getExpectedJson( 'setlabel' ), 
$actual );
 
@@ -138,7 +138,7 @@
 
$module = $this->getApiModule( SetLabel::class, 'wbsetlabel', 
$params, true );
$result = $this->executeApiModule( $module );
-   $actual = $this->removePageInfoAttributes( $result, $entityId );
+   $actual = $this->removePageInfoAttributes( $result );
 
$this->assertEquals( $this->getExpectedJson( 'setlabel-removed' 
), $actual );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac8b6a59b5cf91e5c69d20a5825a50663273ab85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove myself from TravisCI email subscriptions

2016-09-01 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/308119

Change subject: Remove myself from TravisCI email subscriptions
..

Remove myself from TravisCI email subscriptions

Change-Id: If3d6bebe08f0c12bcad42fabc1a686abff0a038b
---
M .travis.yml
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/.travis.yml b/.travis.yml
index 4092bd0..02a06c9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,7 +25,6 @@
 notifications:
   email:
 recipients:
-  - jeroended...@gmail.com
   - abraham.taheriv...@wikimedia.de
 on_success: change
 on_failure: always

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3d6bebe08f0c12bcad42fabc1a686abff0a038b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Added missing dependency to composer.json - change (mediawiki...WikibaseMediaInfo)

2016-06-17 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/294886

Change subject: Added missing dependency to composer.json
..

Added missing dependency to composer.json

Change-Id: I778d01ec6b5811dcd2bc3ccc1d78af24329cdcc2
---
M composer.json
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/composer.json b/composer.json
index a2c6e54..0a39f2f 100644
--- a/composer.json
+++ b/composer.json
@@ -18,7 +18,8 @@
"serialization/serialization": "~3.2",
"wikibase/data-model": "~6.0",
"wikibase/data-model-serialization": "~2.0",
-   "wikibase/data-model-services": "~3.6"
+   "wikibase/data-model-services": "~3.6",
+   "wikimedia/assert": "~0.2.2"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I778d01ec6b5811dcd2bc3ccc1d78af24329cdcc2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseMediaInfo
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Added missing field to ChangeOpMainSnak - change (mediawiki...Wikibase)

2016-06-17 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/294885

Change subject: Added missing field to ChangeOpMainSnak
..

Added missing field to ChangeOpMainSnak

Change-Id: I0a2d58384cf880daf6316f28482381ec450a888d
---
M repo/includes/ChangeOp/ChangeOpMainSnak.php
1 file changed, 1 insertion(+), 7 deletions(-)


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

diff --git a/repo/includes/ChangeOp/ChangeOpMainSnak.php 
b/repo/includes/ChangeOp/ChangeOpMainSnak.php
index 42f81e0..4b886a7 100644
--- a/repo/includes/ChangeOp/ChangeOpMainSnak.php
+++ b/repo/includes/ChangeOp/ChangeOpMainSnak.php
@@ -30,14 +30,8 @@
 */
private $statementGuid;
 
-   /**
-* @var Snak
-*/
private $snak;
-
-   /**
-* @var SnakValidator
-*/
+   private $guidGenerator;
private $snakValidator;
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a2d58384cf880daf6316f28482381ec450a888d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Added missing field in EntityIdReader - change (mediawiki...Wikibase)

2016-06-17 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/294884

Change subject: Added missing field in EntityIdReader
..

Added missing field in EntityIdReader

Change-Id: I0a579216a5e4a8b9a2d1a668ca350798adbe5697
---
M repo/includes/IO/EntityIdReader.php
1 file changed, 6 insertions(+), 8 deletions(-)


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

diff --git a/repo/includes/IO/EntityIdReader.php 
b/repo/includes/IO/EntityIdReader.php
index ab45e66..e1942d3 100644
--- a/repo/includes/IO/EntityIdReader.php
+++ b/repo/includes/IO/EntityIdReader.php
@@ -18,15 +18,8 @@
  */
 class EntityIdReader implements EntityIdPager, Disposable {
 
-   /**
-* @var LineReader
-*/
private $reader;
-
-   /**
-* @var ExceptionHandler
-*/
-   private $exceptionHandler;
+   private $parser;
 
/**
 * @var string|null
@@ -34,6 +27,11 @@
private $entityType;
 
/**
+* @var ExceptionHandler
+*/
+   private $exceptionHandler;
+
+   /**
 * @param LineReader $reader
 * @param EntityIdParser $parser
 * @param null|string $entityType The desired entity type, or null for 
any type.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a579216a5e4a8b9a2d1a668ca350798adbe5697
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Added missing field in EntityIdRdfBuilder. - change (mediawiki...Wikibase)

2016-06-17 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/294883

Change subject: Added missing field in EntityIdRdfBuilder.
..

Added missing field in EntityIdRdfBuilder.

Change-Id: I534558bd5a4e97b9a339a3e8a485cb13057f1c2b
---
M repo/includes/Rdf/Values/EntityIdRdfBuilder.php
1 file changed, 1 insertion(+), 4 deletions(-)


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

diff --git a/repo/includes/Rdf/Values/EntityIdRdfBuilder.php 
b/repo/includes/Rdf/Values/EntityIdRdfBuilder.php
index 8d065e5..02dc29a 100644
--- a/repo/includes/Rdf/Values/EntityIdRdfBuilder.php
+++ b/repo/includes/Rdf/Values/EntityIdRdfBuilder.php
@@ -19,9 +19,7 @@
  */
 class EntityIdRdfBuilder implements ValueSnakRdfBuilder {
 
-   /**
-* @var EntityMentionListener
-*/
+   private $vocabulary;
private $mentionedEntityTracker;
 
/**
@@ -30,7 +28,6 @@
 */
public function __construct( RdfVocabulary $vocabulary, 
EntityMentionListener $mentionedEntityTracker ) {
$this->vocabulary = $vocabulary;
-
$this->mentionedEntityTracker = $mentionedEntityTracker;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I534558bd5a4e97b9a339a3e8a485cb13057f1c2b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Added missing dependency to composer.json - change (mediawiki...Wikibase)

2016-06-17 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/294882

Change subject: Added missing dependency to composer.json
..

Added missing dependency to composer.json

Rather surprised no one noticed this...

Change-Id: I3fcd9d652a7427f2938b40add397868ff0ed792f
---
M composer.json
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/composer.json b/composer.json
index f6d63e1..d563171 100644
--- a/composer.json
+++ b/composer.json
@@ -41,7 +41,8 @@
"wikibase/javascript-api": "~1.1",
"wikibase/serialization-javascript": "~2.0.5",
"diff/diff": "~2.0",
-   "wikimedia/purtle": "~1.0"
+   "wikimedia/purtle": "~1.0",
+   "wikimedia/assert": "~0.2.2"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fcd9d652a7427f2938b40add397868ff0ed792f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Removed dead argument - change (mediawiki...Wikibase)

2016-06-17 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/294881

Change subject: Removed dead argument
..

Removed dead argument

Change-Id: Iab97a35f697793ef751864cffcc95876b73eec18
---
M lib/includes/Interactors/TermIndexSearchInteractor.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/lib/includes/Interactors/TermIndexSearchInteractor.php 
b/lib/includes/Interactors/TermIndexSearchInteractor.php
index ff6d045..962152b 100644
--- a/lib/includes/Interactors/TermIndexSearchInteractor.php
+++ b/lib/includes/Interactors/TermIndexSearchInteractor.php
@@ -165,7 +165,7 @@
),
null,
$entityType,
-   $this->getTermIndexOptions( $this->termSearchOptions )
+   $this->getTermIndexOptions()
);
 
$limit = $this->termSearchOptions->getLimit();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab97a35f697793ef751864cffcc95876b73eec18
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Fixed capitalization in method calls - change (mediawiki...Wikibase)

2016-06-17 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/294879

Change subject: Fixed capitalization in method calls
..

Fixed capitalization in method calls

Change-Id: I406f82c65f3feb5f4ecf247efade3b82604df3d8
---
M lib/tests/phpunit/Store/TermIndexTest.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/lib/tests/phpunit/Store/TermIndexTest.php 
b/lib/tests/phpunit/Store/TermIndexTest.php
index 5fd1833..dcad9b3 100644
--- a/lib/tests/phpunit/Store/TermIndexTest.php
+++ b/lib/tests/phpunit/Store/TermIndexTest.php
@@ -71,7 +71,7 @@
}
 
public function provideGetMatchingTerms() {
-   list( $item0, $item1, $item2 ) = $this->getTestitems();
+   list( $item0, $item1, $item2 ) = $this->getTestItems();
 
return array(
'cross-language match' => array(
@@ -249,7 +249,7 @@
 * @see provideGetMatchingTerms
 */
public function provideGetTopMatchingTerms() {
-   list( $item0, $item1, $item2 ) = $this->getTestitems();
+   list( $item0, $item1, $item2 ) = $this->getTestItems();
 
return array(
'EXACT MATCH not prefix, case sensitive' => array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I406f82c65f3feb5f4ecf247efade3b82604df3d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Provide several tweaks - change (mediawiki...SemanticImageInput)

2016-05-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Provide several tweaks
..


Provide several tweaks

* Updated INSTALL file
* Updated README file
* Formatted COPYING file
* Provide license label to show on "Special:Version"
* Go https
* Do linkfixes
* Minor formatting of SemanticImageInput.php
* Consistently switch to use __DIR__

Bug: T123943
Change-Id: I98f57637e74e7d7e2a4ef133a09dcfd353502e19
---
M COPYING
M INSTALL
M README
M SemanticImageInput.php
4 files changed, 32 insertions(+), 30 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/COPYING b/COPYING
index f583e2f..2677105 100644
--- a/COPYING
+++ b/COPYING
@@ -1,8 +1,9 @@
-The license text below "" applies to all files within this distribution, 
other
-than those that are in a directory which contains files named "LICENSE" or
-"COPYING", or a subdirectory thereof. For those files, the license text 
contained in
-said file overrides any license information contained in directories of 
smaller depth.
-Alternative licenses are typically used for software that is provided by 
external
+The license text below "" applies to all files within this
+distribution, other than those that are in a directory which contains
+files named "LICENSE" or "COPYING", or a subdirectory thereof. For those
+files, the license text contained in said file overrides any license
+information contained in directories of smaller depth. Alternative
+licenses are typically used for software that is provided by external
 parties, and merely packaged with this software for convenience.
 
 
@@ -679,4 +680,4 @@
 may consider it more useful to permit linking proprietary applications with
 the library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.  But first, please read
-.
\ No newline at end of file
+.
diff --git a/INSTALL b/INSTALL
index 2bce5cb..43a2be5 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
 These is the install file for the Semantic Image Input extension.

 Extension page on mediawiki.org: 
https://www.mediawiki.org/wiki/Extension:Semantic_Image_Input
-Latest version of the install file: 
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SemanticImageInput/INSTALL?view=co
+Latest version of the install file: 
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSemanticImageInput.git/master/INSTALL
 
 
 == Requirements ==
@@ -14,25 +14,27 @@
 
 == Download ==
 
-You can get the code directly from SVN. Tags can be obtained via
+You can get the code directly from Git.
 
- svn checkout 
http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/SemanticImageInput/REL_version
+ cd /path/to/extensions 
+ git clone 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticImageInput.git
 
-Where 'version' is the version number of the tag, such as 0_1 (see the 
[http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/SemanticImageInput/ 
available tags]).
-The latest code can be obtained from trunk:
+Tags can be viewed like
 
- svn checkout 
http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticImageInput/
+ cd /SemanticImageInput
+ git tag -l
+ git checkout 
 
 == Installation ==
 
 Once you have downloaded the code, place the ''SemanticImageInput'' directory 
within your MediaWiki
-'extensions' directory. Then add the following code to your 
[[Manual:LocalSettings.php|LocalSettings.php]] file:
+'extensions' directory. Then add the following code to your 
"LocalSettings.php" file:
 
 # Semantic Image Input
-require_once( "$IP/extensions/SemanticImageInput/SemanticImageInput.php" );
+require_once "$IP/extensions/SemanticImageInput/SemanticImageInput.php";
 
 You also need to enable instant commons: 
https://www.mediawiki.org/wiki/Instant_commons
-This is done by adding the following code to your LocalSettings.php file:
+This is done by adding the following code to your "LocalSettings.php" file:
 
 # Enable instant commons
 $wgUseInstantCommons  = true;
@@ -42,10 +44,10 @@
 
 == Configuration ==
 
-Configuration of Contest is done by assigning to $egSIISettings in your
-[[Manual:LocalSettings.php|LocalSettings.php]] file, AFTER the inclusion of the
-extension. The options are listed below and their default is set in the 
Contest settings file:
-http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SemanticImageInput/SemanticImageInput.settings.php?view=markup
+Configuration of Contest is done by assigning to $egSIISettings in your 
"LocalSettings.php" file,
+AFTER the inclusion of the extension. The options are listed below and their 
default is set in the
+settings file:
+https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSemanticImageInput.git/master/SemanticImageInput.settings.php
 You should NOT modify the 

[MediaWiki-commits] [Gerrit] Fix branch alias - change (mediawiki...SemanticForms)

2016-04-02 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/281233

Change subject: Fix branch alias
..

Fix branch alias

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


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

diff --git a/composer.json b/composer.json
index 67122c2..6ac5493 100644
--- a/composer.json
+++ b/composer.json
@@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
-   "dev-master": "2.8.x-dev"
+   "dev-master": "3.6.x-dev"
},
"installer-paths": {
"../{$name}": ["mediawiki/open-layers"]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id524cef5a281f1e3e58626487ad54bd0d56a3a84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Stop doing $that = $this in Client Tests - change (mediawiki...Wikibase)

2016-02-07 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Stop doing $that = $this in Client Tests
..


Stop doing $that = $this in Client Tests

Closuers support $this as of 5.4

Change-Id: Ib003ca21e6d1554e1ce5bed4df8f1567db14ffb6
Depends-On: I68c5b5d60952418ff8300c163edfe2275571f41f
---
M 
client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
M 
client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
M 
client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
M client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php
M client/tests/phpunit/includes/LangLinkHandlerTest.php
M client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteTest.php
M client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnMoveTest.php
M client/tests/phpunit/includes/api/PageTermsTest.php
8 files changed, 25 insertions(+), 38 deletions(-)

Approvals:
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
 
b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
index 3bc40e4..e3fc738 100644
--- 
a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php
@@ -149,16 +149,15 @@
$formatterFactory = $this->getMockBuilder( 
'Wikibase\Lib\OutputFormatSnakFormatterFactory' )
->disableOriginalConstructor()
->getMock();
-   $self = $this;
$formatterFactory->expects( $this->once() )
->method( 'getSnakFormatter' )
->will( $this->returnCallback(
-   function( $format, FormatterOptions $options ) 
use ( $self, $allowDataAccessInUserLanguage )  {
-   $self->assertSame(
+   function( $format, FormatterOptions $options ) 
use ( $allowDataAccessInUserLanguage )  {
+   $this->assertSame(
$allowDataAccessInUserLanguage 
? 'es' : 'de',
$options->getOption( 
ValueFormatter::OPT_LANG )
);
-   return $self->getMock( 
'Wikibase\Lib\SnakFormatter' );
+   return $this->getMock( 
'Wikibase\Lib\SnakFormatter' );
}
) );
 
diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
index 11bfc8f..508e34b 100644
--- 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php
@@ -160,10 +160,9 @@
Parser::OT_HTML
);
 
-   $self = $this; // PHP 5.3 ...
$parserOptions->registerWatcher(
-   function( $optionName ) use ( $self, &$cacheSplit ) {
-   $self->assertSame( 'userlang', $optionName );
+   function( $optionName ) use ( &$cacheSplit ) {
+   $this->assertSame( 'userlang', $optionName );
$cacheSplit = true;
}
);
diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
index 21582d4..2a3a9f6 100644
--- 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
@@ -319,10 +319,9 @@
Parser::OT_HTML
);
 
-   $self = $this; // PHP 5.3 ...
$parserOptions->registerWatcher(
-   function( $optionName ) use ( $self, &$cacheSplit ) {
-   $self->assertSame( 'userlang', $optionName );
+   function( $optionName ) use ( &$cacheSplit ) {
+   $this->assertSame( 'userlang', $optionName );
$cacheSplit = true;
}
);
diff --git 
a/client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php 

[MediaWiki-commits] [Gerrit] Remove string refs to function and make it non-public - change (mediawiki...Wikibase)

2015-12-09 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/257855

Change subject: Remove string refs to function and make it non-public
..

Remove string refs to function and make it non-public

Change-Id: Iacc9852a35f131327b3afbc2c890bab7faf7b977
---
M lib/includes/store/sql/SiteLinkTable.php
1 file changed, 24 insertions(+), 24 deletions(-)


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

diff --git a/lib/includes/store/sql/SiteLinkTable.php 
b/lib/includes/store/sql/SiteLinkTable.php
index f224e49..31a3f22 100644
--- a/lib/includes/store/sql/SiteLinkTable.php
+++ b/lib/includes/store/sql/SiteLinkTable.php
@@ -63,28 +63,6 @@
}
 
/**
-* @param SiteLink $a
-* @param SiteLink $b
-*
-* @return int
-*/
-   public function compareSiteLinks( SiteLink $a, SiteLink $b ) {
-   $siteComp = strcmp( $a->getSiteId(), $b->getSiteId() );
-
-   if ( $siteComp !== 0 ) {
-   return $siteComp;
-   }
-
-   $pageComp = strcmp( $a->getPageName(), $b->getPageName() );
-
-   if ( $pageComp !== 0 ) {
-   return $pageComp;
-   }
-
-   return 0;
-   }
-
-   /**
 * @see SiteLinkStore::saveLinksOfItem
 *
 * @since 0.1
@@ -98,8 +76,8 @@
$newLinks = $item->getSiteLinkList()->toArray();
$oldLinks = $this->getSiteLinksForItem( $item->getId() );
 
-   $linksToInsert = array_udiff( $newLinks, $oldLinks, array( 
$this, 'compareSiteLinks' ) );
-   $linksToDelete = array_udiff( $oldLinks, $newLinks, array( 
$this, 'compareSiteLinks' ) );
+   $linksToInsert = $this->diffSiteLinks( $newLinks, $oldLinks );
+   $linksToDelete = $this->diffSiteLinks( $oldLinks, $newLinks );
 
if ( !$linksToInsert && !$linksToDelete ) {
wfDebugLog( __CLASS__, __FUNCTION__ . ": links did not 
change, returning." );
@@ -126,6 +104,28 @@
return $ok;
}
 
+   private function diffSiteLinks( array $firstList, array $secondList ) {
+   return array_udiff(
+   $firstList,
+   $secondList,
+   function( SiteLink $a, SiteLink $b ) {
+   $siteComp = strcmp( $a->getSiteId(), 
$b->getSiteId() );
+
+   if ( $siteComp !== 0 ) {
+   return $siteComp;
+   }
+
+   $pageComp = strcmp( $a->getPageName(), 
$b->getPageName() );
+
+   if ( $pageComp !== 0 ) {
+   return $pageComp;
+   }
+
+   return 0;
+   }
+   );
+   }
+
/**
 * Internal callback for inserting a list of links.
 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacc9852a35f131327b3afbc2c890bab7faf7b977
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead private method - change (mediawiki...Wikibase)

2015-12-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/257579

Change subject: Remove dead private method
..

Remove dead private method

Change-Id: I3fb75cf2685d7a4ff27d19efeb91b9dafbf8988b
---
M 
client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
1 file changed, 0 insertions(+), 12 deletions(-)


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

diff --git 
a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
 
b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
index dd5a2f9..17534c0 100644
--- 
a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
@@ -105,18 +105,6 @@
}
 
/**
-* @param EntityUsage[] $expected
-* @param EntityUsage[] $actual
-* @param string $message
-*/
-   private function assertSameUsages( array $expected, array $actual, 
$message = '' ) {
-   $expected = $this->getUsageStrings( $expected );
-   $actual = $this->getUsageStrings( $actual );
-
-   $this->assertEquals( $expected, $actual, $message );
-   }
-
-   /**
 * @param EntityUsage[] $usages
 *
 * @return string[]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fb75cf2685d7a4ff27d19efeb91b9dafbf8988b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead argument - change (mediawiki...Wikibase)

2015-12-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/257580

Change subject: Remove dead argument
..

Remove dead argument

Change-Id: Ic084fed1798ac331278ab8c929d1b08aa172c638
---
M client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteTest.php
1 file changed, 1 insertion(+), 3 deletions(-)


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

diff --git 
a/client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteTest.php 
b/client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteTest.php
index bdebfda..031154d 100644
--- a/client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteTest.php
+++ b/client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteTest.php
@@ -129,9 +129,7 @@
public function testInjectJob() {
$updateRepo = $this->getNewUpdateRepoOnDelete();
 
-   $jobQueueGroupMock = $this->getJobQueueGroupMock( true );
-
-   $updateRepo->injectJob( $jobQueueGroupMock );
+   $updateRepo->injectJob( $this->getJobQueueGroupMock() );
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic084fed1798ac331278ab8c929d1b08aa172c638
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Make sure $revisionId is always set - change (mediawiki...Wikibase)

2015-12-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/257585

Change subject: Make sure $revisionId is always set
..

Make sure $revisionId is always set

Also extracts the revision id extracting code into own method

Change-Id: I35c37c31128d09cff321406643506253331799ba
---
M repo/includes/api/ResultBuilder.php
1 file changed, 12 insertions(+), 8 deletions(-)


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

diff --git a/repo/includes/api/ResultBuilder.php 
b/repo/includes/api/ResultBuilder.php
index 8b6c026..b89388d 100644
--- a/repo/includes/api/ResultBuilder.php
+++ b/repo/includes/api/ResultBuilder.php
@@ -1098,15 +1098,9 @@
$value = $status->getValue();
 
if ( isset( $value['revision'] ) ) {
-   $revision = $value['revision'];
+   $revisionId = $this->getRevisionId( $value['revision'] 
);
 
-   if ( $revision instanceof Revision ) {
-   $revisionId = $revision->getId();
-   } elseif ( $revision instanceof EntityRevision ) {
-   $revisionId = $revision->getRevisionId();
-   }
-
-   $this->setValue( $path, 'lastrevid', empty( $revisionId 
) ? 0 : $revisionId );
+   $this->setValue( $path, 'lastrevid', $revisionId );
 
if ( $oldRevId && $oldRevId === $revisionId ) {
// like core's ApiEditPage
@@ -1115,4 +1109,14 @@
}
}
 
+   private function getRevisionId( $revision ) {
+   if ( $revision instanceof Revision ) {
+   $revisionId = $revision->getId();
+   } elseif ( $revision instanceof EntityRevision ) {
+   $revisionId = $revision->getRevisionId();
+   }
+
+   return empty( $revisionId ) ? 0 : $revisionId;
+   }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35c37c31128d09cff321406643506253331799ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead priviate test method - change (mediawiki...Wikibase)

2015-12-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/257583

Change subject: Remove dead priviate test method
..

Remove dead priviate test method

Change-Id: I8cbc3bfc4d83dd9dc7d875d0763ce75133a59ea7
---
M repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
1 file changed, 0 insertions(+), 5 deletions(-)


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

diff --git a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php 
b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
index c48c262..ea2d637 100644
--- a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
+++ b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php
@@ -30,11 +30,6 @@
  */
 class EntityContentFactoryTest extends \MediaWikiTestCase {
 
-   private function supportsRedirects() {
-   $handler = ContentHandler::getForModelID( 
CONTENT_MODEL_WIKIBASE_ITEM );
-   return $handler->supportsRedirects();
-   }
-
/**
 * @dataProvider contentModelsProvider
 */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cbc3bfc4d83dd9dc7d875d0763ce75133a59ea7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Fully comment code out - change (mediawiki...Wikibase)

2015-12-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/257584

Change subject: Fully comment code out
..

Fully comment code out

When partially done, this shows up when looking for unused code

Change-Id: I45d9d2c4a1a4f27202451a8225561f89ff521cb9
---
M repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
1 file changed, 5 insertions(+), 5 deletions(-)


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

diff --git 
a/repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php 
b/repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
index 7c3f2b8..6df210f 100644
--- a/repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
+++ b/repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
@@ -111,11 +111,11 @@
new AliasGroupList()
);
 
-   $dupeAliasFingerprint = new Fingerprint(
-   new TermList( array( new Term( 'de', 'good' ) ) ),
-   new TermList(),
-   new AliasGroupList( array( new AliasGroup( 'de', array( 
'DUPE' ) ) ) )
-   );
+// $dupeAliasFingerprint = new Fingerprint(
+// new TermList( array( new Term( 'de', 'good' ) ) ),
+// new TermList(),
+// new AliasGroupList( array( new AliasGroup( 'de', array( 
'DUPE' ) ) ) )
+// );
 
return array(
'conflicting label' => array( $dupeLabelFingerprint, 
'label-conflict' ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I45d9d2c4a1a4f27202451a8225561f89ff521cb9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead argument - change (mediawiki...Wikibase)

2015-12-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/257582

Change subject: Remove dead argument
..

Remove dead argument

Change-Id: Ia16330c7bc4d69a2d6eb498430d8395d283ed372
---
M repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php 
b/repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php
index 1cb5879..77c88de 100644
--- a/repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php
+++ b/repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php
@@ -32,8 +32,7 @@
array(
'Q12' => 'wb-badge-goodarticle',
'Q42' => 'wb-badge-featuredarticle'
-   ),
-   true
+   )
);
 
$expected = array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia16330c7bc4d69a2d6eb498430d8395d283ed372
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead var - change (mediawiki...Wikibase)

2015-12-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/257578

Change subject: Remove dead var
..

Remove dead var

Change-Id: If3ae39a941e28c8dbb8cd27a57c0d58a3c2d0c6b
---
M client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git 
a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php
 
b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php
index 33f58c7..6236ff7 100644
--- 
a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/RunnerTest.php
@@ -103,7 +103,7 @@
 
$parser = $this->getParser();
$frame = $this->getFromFrame( $itemId->getSerialization() );
-   $result = $runner->runPropertyParserFunction( $parser, $frame, 
array( 'Cat', $this->getMock( 'PPNode' ) ) );
+   $runner->runPropertyParserFunction( $parser, $frame, array( 
'Cat', $this->getMock( 'PPNode' ) ) );
 
// Still 0 as the entity has been loaded before
$this->assertSame( 0, $parser->mExpensiveFunctionCount );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3ae39a941e28c8dbb8cd27a57c0d58a3c2d0c6b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Fix phpcs in TermIndexSearchInteractor & Test - change (mediawiki...Wikibase)

2015-12-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Fix phpcs in TermIndexSearchInteractor & Test
..


Fix phpcs in TermIndexSearchInteractor & Test

Change-Id: I2006ad048be6e40da1e3a9b2ef32960847580d4e
---
M repo/includes/Interactors/TermIndexSearchInteractor.php
M repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php
2 files changed, 22 insertions(+), 5 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved



diff --git a/repo/includes/Interactors/TermIndexSearchInteractor.php 
b/repo/includes/Interactors/TermIndexSearchInteractor.php
index 15b9f20..4cfa4d5 100644
--- a/repo/includes/Interactors/TermIndexSearchInteractor.php
+++ b/repo/includes/Interactors/TermIndexSearchInteractor.php
@@ -164,7 +164,12 @@
 * @returns TermSearchResult[]
 */
public function searchForEntities( $text, $languageCode, $entityType, 
array $termTypes ) {
-   $matchedTermIndexEntries = $this->getMatchingTermIndexEntries( 
$text, $languageCode, $entityType, $termTypes );
+   $matchedTermIndexEntries = $this->getMatchingTermIndexEntries(
+   $text,
+   $languageCode,
+   $entityType,
+   $termTypes
+   );
$entityIds = $this->getEntityIdsForTermIndexEntries( 
$matchedTermIndexEntries );
 
$this->preFetchLabelsAndDescriptionsForDisplay( $entityIds );
@@ -179,7 +184,12 @@
 *
 * @return TermIndexEntry[]
 */
-   private function getMatchingTermIndexEntries( $text, $languageCode, 
$entityType, array $termTypes ) {
+   private function getMatchingTermIndexEntries(
+   $text,
+   $languageCode,
+   $entityType,
+   array $termTypes
+   ) {
$languageCodes = array( $languageCode );
$matchedTermIndexEntries = 
$this->termIndex->getTopMatchingTerms(
$this->makeTermIndexEntryTemplates(
@@ -215,13 +225,19 @@
 
// Remove any IndexEntries that are already have an 
match for
foreach ( $fallbackMatchedTermIndexEntries as $key => 
$termIndexEntry ) {
-   if ( in_array( 
$termIndexEntry->getEntityId()->getSerialization(), 
$matchedEntityIdSerializations ) ) {
+   if ( in_array(
+   
$termIndexEntry->getEntityId()->getSerialization(),
+   $matchedEntityIdSerializations
+   ) ) {
unset( 
$fallbackMatchedTermIndexEntries[$key] );
}
}
 
// Matches in the main language will always be first
-   $matchedTermIndexEntries = array_merge( 
$matchedTermIndexEntries, $fallbackMatchedTermIndexEntries );
+   $matchedTermIndexEntries = array_merge(
+   $matchedTermIndexEntries,
+   $fallbackMatchedTermIndexEntries
+   );
if ( count( $matchedTermIndexEntries ) > $this->limit ) 
{
array_slice( $matchedTermIndexEntries, 0, 
$this->limit, true );
}
diff --git 
a/repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php 
b/repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php
index b8b4359..6316559 100644
--- a/repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php
+++ b/repo/tests/phpunit/includes/Interactors/TermIndexSearchInteractorTest.php
@@ -96,7 +96,8 @@
->will( $this->returnCallback( function( EntityId 
$entityId, $languageCodes ) {
$descriptions = array();
foreach ( $languageCodes as $languageCode ) {
-   $descriptions[$languageCode] = 
'description-' . $languageCode . '-' . $entityId->getSerialization();
+   $descriptions[$languageCode] =
+   'description-' . $languageCode 
. '-' . $entityId->getSerialization();
}
return $descriptions;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2006ad048be6e40da1e3a9b2ef32960847580d4e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Daniel Kinzler 

[MediaWiki-commits] [Gerrit] Move statement filtering from GetClaims API to dedicated class - change (mediawiki...Wikibase)

2015-11-25 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/255371

Change subject: Move statement filtering from GetClaims API to dedicated class
..

Move statement filtering from GetClaims API to dedicated class

Change-Id: I89e6815a3774e4c0a4d68b193bb044a9ea07017c
---
M repo/includes/api/GetClaims.php
A repo/includes/api/GetClaimsStatementFilter.php
2 files changed, 86 insertions(+), 38 deletions(-)


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

diff --git a/repo/includes/api/GetClaims.php b/repo/includes/api/GetClaims.php
index 3edc4e7..1f0bb4e 100644
--- a/repo/includes/api/GetClaims.php
+++ b/repo/includes/api/GetClaims.php
@@ -27,7 +27,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Adam Shorland
  */
-class GetClaims extends ApiBase implements StatementFilter {
+class GetClaims extends ApiBase {
 
/**
 * @var StatementGuidValidator
@@ -129,49 +129,19 @@
}
 
if ( $guid === null ) {
-   return $entity->getStatements()->filter( $this );
+   return $entity->getStatements()->filter( 
$this->newRequestParamsBasedFilter() );
}
 
$statement = 
$entity->getStatements()->getFirstStatementWithGuid( $guid );
return $statement === null ? array() : array( $statement );
}
 
-   public function statementMatches( Statement $statement ) {
-   return $this->rankMatchesFilter( $statement->getRank() )
-   && $this->propertyMatchesFilter( 
$statement->getPropertyId() );
-   }
-
-   private function rankMatchesFilter( $rank ) {
-   if ( $rank === null ) {
-   return true;
-   }
-   $params = $this->extractRequestParams();
-
-   if ( isset( $params['rank'] ) ) {
-   $statementRankSerializer = new 
StatementRankSerializer();
-   $unserializedRank = 
$statementRankSerializer->deserialize( $params['rank'] );
-   $matchFilter = $rank === $unserializedRank;
-   return $matchFilter;
-   }
-
-   return true;
-   }
-
-   private function propertyMatchesFilter( EntityId $propertyId ) {
-   $params = $this->extractRequestParams();
-
-   if ( isset( $params['property'] ) ) {
-   try {
-   $parsedProperty = $this->idParser->parse( 
$params['property'] );
-   } catch ( EntityIdParsingException $e ) {
-   $this->errorReporter->dieException( $e, 
'param-invalid' );
-   }
-
-   /** @var EntityId $parsedProperty */
-   return $propertyId->equals( $parsedProperty );
-   }
-
-   return true;
+   private function newRequestParamsBasedFilter() {
+   return new GetClaimsStatementFilter(
+   $this->idParser,
+   $this->errorReporter,
+   $this->extractRequestParams()
+   );
}
 
/**
diff --git a/repo/includes/api/GetClaimsStatementFilter.php 
b/repo/includes/api/GetClaimsStatementFilter.php
new file mode 100644
index 000..424893c
--- /dev/null
+++ b/repo/includes/api/GetClaimsStatementFilter.php
@@ -0,0 +1,78 @@
+
+ */
+class GetClaimsStatementFilter implements StatementFilter {
+
+   /**
+* @var ApiErrorReporter
+*/
+   private $errorReporter;
+
+   /**
+* @var EntityIdParser
+*/
+   private $idParser;
+
+   /**
+* @var array
+*/
+   private $requestParams;
+
+   public function __construct( EntityIdParser $idParser, ApiErrorReporter 
$errorReporter, array $requestParams ) {
+   $this->idParser = $idParser;
+   $this->errorReporter = $errorReporter;
+   $this->requestParams = $requestParams;
+   }
+   
+   /**
+* @param Statement $statement
+*
+* @return boolean
+*/
+   public function statementMatches( Statement $statement ) {
+   return $this->rankMatchesFilter( $statement->getRank() )
+   && $this->propertyMatchesFilter( 
$statement->getPropertyId() );
+   }
+
+   private function rankMatchesFilter( $rank ) {
+   if ( $rank === null ) {
+   return true;
+   }
+
+   if ( isset( $this->requestParams['rank'] ) ) {
+   $statementRankSerializer = new 
StatementRankSerializer();
+   $unserializedRank = 
$statementRankSerializer->deserialize( $this->requestParams['rank'] );
+   return $rank === 

[MediaWiki-commits] [Gerrit] Demonstrate StatementList::filter utility - change (mediawiki...Wikibase)

2015-11-25 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/255370

Change subject: Demonstrate StatementList::filter utility
..

Demonstrate StatementList::filter utility

Change-Id: Id050ad0b3dd77b100a348c0532fb951ef80cb7b1
---
M repo/includes/api/GetClaims.php
1 file changed, 4 insertions(+), 15 deletions(-)


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

diff --git a/repo/includes/api/GetClaims.php b/repo/includes/api/GetClaims.php
index 3bcf56a..3edc4e7 100644
--- a/repo/includes/api/GetClaims.php
+++ b/repo/includes/api/GetClaims.php
@@ -11,6 +11,7 @@
 use Wikibase\DataModel\Services\Statement\StatementGuidParser;
 use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\DataModel\Statement\Statement;
+use Wikibase\DataModel\Statement\StatementFilter;
 use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\DataModel\Statement\StatementListProvider;
 use Wikibase\Lib\Store\EntityRevisionLookup;
@@ -26,7 +27,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Adam Shorland
  */
-class GetClaims extends ApiBase {
+class GetClaims extends ApiBase implements StatementFilter {
 
/**
 * @var StatementGuidValidator
@@ -128,26 +129,14 @@
}
 
if ( $guid === null ) {
-   return $this->getMatchingStatements( 
$entity->getStatements() );
+   return $entity->getStatements()->filter( $this );
}
 
$statement = 
$entity->getStatements()->getFirstStatementWithGuid( $guid );
return $statement === null ? array() : array( $statement );
}
 
-   private function getMatchingStatements( StatementList $statementList ) {
-   $statements = array();
-
-   foreach ( $statementList->toArray() as $statement ) {
-   if ( $this->statementMatchesFilters( $statement ) ) {
-   $statements[] = $statement;
-   }
-   }
-
-   return $statements;
-   }
-
-   private function statementMatchesFilters( Statement $statement ) {
+   public function statementMatches( Statement $statement ) {
return $this->rankMatchesFilter( $statement->getRank() )
&& $this->propertyMatchesFilter( 
$statement->getPropertyId() );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id050ad0b3dd77b100a348c0532fb951ef80cb7b1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Move statement filtering from GetClaims API to dedicated class - change (mediawiki...Wikibase)

2015-11-25 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/255374

Change subject: Move statement filtering from GetClaims API to dedicated class
..

Move statement filtering from GetClaims API to dedicated class

This moves the code out of the API module, imporving decoupling
and allowing for API-independent tests of its logic.

This also removes the manual filtering that was happening before
by instead using StatementList::filter. To see this simplification
on its own, have a look at
https://gerrit.wikimedia.org/r/#/c/255370/1/repo/includes/api/GetClaims.php

Change-Id: I44077aefcc2ec77be7ba489ec9ac5f264054b800
---
M repo/includes/api/GetClaims.php
A repo/includes/api/GetClaimsStatementFilter.php
2 files changed, 89 insertions(+), 51 deletions(-)


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

diff --git a/repo/includes/api/GetClaims.php b/repo/includes/api/GetClaims.php
index 3bcf56a..5353d0a 100644
--- a/repo/includes/api/GetClaims.php
+++ b/repo/includes/api/GetClaims.php
@@ -11,7 +11,6 @@
 use Wikibase\DataModel\Services\Statement\StatementGuidParser;
 use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\DataModel\Statement\Statement;
-use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\DataModel\Statement\StatementListProvider;
 use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Repo\WikibaseRepo;
@@ -127,62 +126,22 @@
return array();
}
 
+   $statements = $entity->getStatements();
+
if ( $guid === null ) {
-   return $this->getMatchingStatements( 
$entity->getStatements() );
+   return $statements->filter( 
$this->newRequestParamsBasedFilter() )->toArray();
}
 
-   $statement = 
$entity->getStatements()->getFirstStatementWithGuid( $guid );
+   $statement = $statements->getFirstStatementWithGuid( $guid );
return $statement === null ? array() : array( $statement );
}
 
-   private function getMatchingStatements( StatementList $statementList ) {
-   $statements = array();
-
-   foreach ( $statementList->toArray() as $statement ) {
-   if ( $this->statementMatchesFilters( $statement ) ) {
-   $statements[] = $statement;
-   }
-   }
-
-   return $statements;
-   }
-
-   private function statementMatchesFilters( Statement $statement ) {
-   return $this->rankMatchesFilter( $statement->getRank() )
-   && $this->propertyMatchesFilter( 
$statement->getPropertyId() );
-   }
-
-   private function rankMatchesFilter( $rank ) {
-   if ( $rank === null ) {
-   return true;
-   }
-   $params = $this->extractRequestParams();
-
-   if ( isset( $params['rank'] ) ) {
-   $statementRankSerializer = new 
StatementRankSerializer();
-   $unserializedRank = 
$statementRankSerializer->deserialize( $params['rank'] );
-   $matchFilter = $rank === $unserializedRank;
-   return $matchFilter;
-   }
-
-   return true;
-   }
-
-   private function propertyMatchesFilter( EntityId $propertyId ) {
-   $params = $this->extractRequestParams();
-
-   if ( isset( $params['property'] ) ) {
-   try {
-   $parsedProperty = $this->idParser->parse( 
$params['property'] );
-   } catch ( EntityIdParsingException $e ) {
-   $this->errorReporter->dieException( $e, 
'param-invalid' );
-   }
-
-   /** @var EntityId $parsedProperty */
-   return $propertyId->equals( $parsedProperty );
-   }
-
-   return true;
+   private function newRequestParamsBasedFilter() {
+   return new GetClaimsStatementFilter(
+   $this->idParser,
+   $this->errorReporter,
+   $this->extractRequestParams()
+   );
}
 
/**
diff --git a/repo/includes/api/GetClaimsStatementFilter.php 
b/repo/includes/api/GetClaimsStatementFilter.php
new file mode 100644
index 000..95d128a
--- /dev/null
+++ b/repo/includes/api/GetClaimsStatementFilter.php
@@ -0,0 +1,79 @@
+
+ * @author Adam Shorland
+ */
+class GetClaimsStatementFilter implements StatementFilter {
+
+   /**
+* @var ApiErrorReporter
+*/
+   private $errorReporter;
+
+   /**
+* @var EntityIdParser
+*/
+   private $idParser;
+
+   /**
+* @var array
+*/
+   

[MediaWiki-commits] [Gerrit] Use Composer cache on TravisCI - change (mediawiki...Wikibase)

2015-11-08 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/251923

Change subject: Use Composer cache on TravisCI
..

Use Composer cache on TravisCI

Change-Id: I21ce71603741317cf75e24d0a3539ccc7e84d4e7
---
M .travis.yml
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/.travis.yml b/.travis.yml
index cc0927a..165e574 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,3 +38,7 @@
 on_failure: always
 template:
   - "%{repository}/%{branch}/%{commit} : %{author} %{message} %{build_url}"
+
+cache:
+  directories:
+- $HOME/.composer/cache

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21ce71603741317cf75e24d0a3539ccc7e84d4e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Decrease binding in EntityParserOutputDataUpdater - change (mediawiki...Wikibase)

2015-11-05 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/251260

Change subject: Decrease binding in EntityParserOutputDataUpdater
..

Decrease binding in EntityParserOutputDataUpdater

And make the method names more clearly match their responsibility

Change-Id: I7b68c4f6a861b5cf2eca9893aa061261654d71b0
---
M repo/includes/ParserOutput/EntityParserOutputDataUpdater.php
1 file changed, 8 insertions(+), 15 deletions(-)


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

diff --git a/repo/includes/ParserOutput/EntityParserOutputDataUpdater.php 
b/repo/includes/ParserOutput/EntityParserOutputDataUpdater.php
index 1b68c94..007b656 100644
--- a/repo/includes/ParserOutput/EntityParserOutputDataUpdater.php
+++ b/repo/includes/ParserOutput/EntityParserOutputDataUpdater.php
@@ -6,6 +6,8 @@
 use ParserOutput;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\Item;
+use Wikibase\DataModel\SiteLinkList;
+use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\DataModel\Statement\StatementListProvider;
 
 /**
@@ -61,43 +63,34 @@
$this->dataUpdaters = $dataUpdaters;
}
 
-   /**
-* @param EntityDocument $entity
-*/
public function processEntity( EntityDocument $entity ) {
if ( $entity instanceof StatementListProvider ) {
-   $this->processStatementListProvider( $entity );
+   $this->processStatementList( $entity->getStatements() );
}
 
if ( $entity instanceof Item ) {
-   $this->processItem( $entity );
+   $this->processSiteLinks( $entity->getSiteLinkList() );
}
}
 
-   /**
-* @param StatementListProvider $entity
-*/
-   private function processStatementListProvider( StatementListProvider 
$entity ) {
+   private function processStatementList( StatementList $statements ) {
if ( empty( $this->statementDataUpdaters ) ) {
return;
}
 
-   foreach ( $entity->getStatements() as $statement ) {
+   foreach ( $statements as $statement ) {
foreach ( $this->statementDataUpdaters as $updater ) {
$updater->processStatement( $statement );
}
}
}
 
-   /**
-* @param Item $item
-*/
-   private function processItem( Item $item ) {
+   private function processSiteLinks( SiteLinkList $siteLinks ) {
if ( empty( $this->siteLinkDataUpdaters ) ) {
return;
}
 
-   foreach ( $item->getSiteLinkList() as $siteLink ) {
+   foreach ( $siteLinks as $siteLink ) {
foreach ( $this->siteLinkDataUpdaters as $updater ) {
$updater->processSiteLink( $siteLink );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b68c4f6a861b5cf2eca9893aa061261654d71b0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove unused imports - change (mediawiki...Wikibase)

2015-11-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Remove unused imports
..


Remove unused imports

Change-Id: I63e5fd4e2887d24514c65f9a3b923d55eab85b8a
---
M repo/Wikibase.hooks.php
M repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php
2 files changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index 7ae51e6..24d3da8 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -30,7 +30,6 @@
 use Wikibase\Lib\Store\ChangeLookup;
 use Wikibase\Repo\Content\EntityHandler;
 use Wikibase\Repo\Hooks\OutputPageEntityIdReader;
-use Wikibase\Repo\Hooks\OutputPageJsConfigHookHandler;
 use Wikibase\Repo\WikibaseRepo;
 use WikiPage;
 
diff --git a/repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php 
b/repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php
index aba2c69..4801474 100644
--- a/repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php
+++ b/repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php
@@ -13,7 +13,6 @@
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
 use Wikibase\Repo\Store\EntityPerPage;
 use Wikibase\Repo\Store\SQL\EntityPerPageTable;
-use Wikibase\Repo\WikibaseRepo;
 
 /**
  * @covers Wikibase\Repo\Store\SQL\EntityPerPageTable

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I63e5fd4e2887d24514c65f9a3b923d55eab85b8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Jeroen De Dauw 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Remove unused imports - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250725

Change subject: Remove unused imports
..

Remove unused imports

Change-Id: I63e5fd4e2887d24514c65f9a3b923d55eab85b8a
---
M repo/Wikibase.hooks.php
M repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php
2 files changed, 0 insertions(+), 2 deletions(-)


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

diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index 7ae51e6..24d3da8 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -30,7 +30,6 @@
 use Wikibase\Lib\Store\ChangeLookup;
 use Wikibase\Repo\Content\EntityHandler;
 use Wikibase\Repo\Hooks\OutputPageEntityIdReader;
-use Wikibase\Repo\Hooks\OutputPageJsConfigHookHandler;
 use Wikibase\Repo\WikibaseRepo;
 use WikiPage;
 
diff --git a/repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php 
b/repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php
index aba2c69..4801474 100644
--- a/repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php
+++ b/repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php
@@ -13,7 +13,6 @@
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
 use Wikibase\Repo\Store\EntityPerPage;
 use Wikibase\Repo\Store\SQL\EntityPerPageTable;
-use Wikibase\Repo\WikibaseRepo;
 
 /**
  * @covers Wikibase\Repo\Store\SQL\EntityPerPageTable

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63e5fd4e2887d24514c65f9a3b923d55eab85b8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Do not hide parent constructor - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250730

Change subject: Do not hide parent constructor
..

Do not hide parent constructor

Change-Id: Ic3d7adcc23cc702e72801749ec2062fb1ccddc40
---
M lib/includes/store/sql/SiteLinkTable.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/lib/includes/store/sql/SiteLinkTable.php 
b/lib/includes/store/sql/SiteLinkTable.php
index 876f5d3..f224e49 100644
--- a/lib/includes/store/sql/SiteLinkTable.php
+++ b/lib/includes/store/sql/SiteLinkTable.php
@@ -58,7 +58,8 @@
 
$this->table = $table;
$this->readonly = $readonly;
-   $this->wiki = $wiki;
+
+   parent::__construct( $wiki );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3d7adcc23cc702e72801749ec2062fb1ccddc40
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead argument - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250735

Change subject: Remove dead argument
..

Remove dead argument

Change-Id: Ic81315397493753f48f7373846923608749354f2
---
M client/includes/Hooks/ChangesPageWikibaseFilterHandler.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/client/includes/Hooks/ChangesPageWikibaseFilterHandler.php 
b/client/includes/Hooks/ChangesPageWikibaseFilterHandler.php
index aae0a26..45f358b 100644
--- a/client/includes/Hooks/ChangesPageWikibaseFilterHandler.php
+++ b/client/includes/Hooks/ChangesPageWikibaseFilterHandler.php
@@ -71,7 +71,7 @@
return $filters;
}
 
-   $toggleDefault = $this->showWikibaseEditsByDefault( $user, 
$this->optionName );
+   $toggleDefault = $this->showWikibaseEditsByDefault( $user );
$filters = $this->addFilter( $filters, $toggleDefault );
 
return $filters;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic81315397493753f48f7373846923608749354f2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250729

Change subject: Remove dead code
..

Remove dead code

Change-Id: Ic4e3e780fe3f9ef1ff548f7f89f714454480b7b3
---
M repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
M repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
M repo/tests/phpunit/includes/content/EntityHandlerTest.php
3 files changed, 11 insertions(+), 19 deletions(-)


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

diff --git 
a/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php 
b/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
index b5a096f..499caef 100644
--- a/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/SiteLinkChangeOpFactoryTest.php
@@ -29,7 +29,7 @@
}
 
public function testNewRemoveSiteLinkOp() {
-   $op = $this->newChangeOpFactory()->newRemoveSiteLinkOp( 
'enwiki', 'Foo' );
+   $op = $this->newChangeOpFactory()->newRemoveSiteLinkOp( 
'enwiki' );
$this->assertInstanceOf( 'Wikibase\ChangeOp\ChangeOp', $op );
}
 
diff --git a/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php 
b/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
index 57bb127..20c83ab 100644
--- a/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
+++ b/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
@@ -275,23 +275,23 @@
 
public function provideValidateDataValue() {
return array(
-   array( new StringValue( '123' ), 'numeric', 'p1', 
'valid numeric value', true ),
-   array( new StringValue( '123' ), 'alphabetic', 'p2', 
'invalid alphabetic value', false ),
-   array( new StringValue( 'abc' ), 'alphabetic', 'p2', 
'valid alphabetic value', true ),
-   array( new StringValue( 'abc' ), 'numeric', 'p1', 
'invalid numeric value', false ),
-   array( new StringValue( '01234567890123456789' ), 
'numeric', 'p1', 'overly long numeric value', false ),
-   array( new UnknownValue( 'abc' ), 'alphabetic', 'p2', 
'bad value type', false ),
-   array( new UnDeserializableValue( 'abc', 'string', 
'error' ), 'numeric', 'p1', 'bad value', false ),
+   array( new StringValue( '123' ), 'numeric', 'valid 
numeric value', true ),
+   array( new StringValue( '123' ), 'alphabetic', 'invalid 
alphabetic value', false ),
+   array( new StringValue( 'abc' ), 'alphabetic', 'valid 
alphabetic value', true ),
+   array( new StringValue( 'abc' ), 'numeric', 'invalid 
numeric value', false ),
+   array( new StringValue( '01234567890123456789' ), 
'numeric', 'overly long numeric value', false ),
+   array( new UnknownValue( 'abc' ), 'alphabetic', 'bad 
value type', false ),
+   array( new UnDeserializableValue( 'abc', 'string', 
'error' ), 'numeric', 'bad value', false ),
);
}
 
/**
 * @dataProvider provideValidateDataValue
 */
-   public function testValidateDataValue( DataValue $dataValue, 
$dataTypeId, $propertyName, $description, $expectedValid = true ) {
+   public function testValidateDataValue( DataValue $dataValue, 
$dataTypeId, $description, $expectedValid = true ) {
$validator = $this->getSnakValidator();
 
-   $result = $validator->validateDataValue( $dataValue, 
$dataTypeId, $propertyName );
+   $result = $validator->validateDataValue( $dataValue, 
$dataTypeId );
 
$this->assertEquals( $expectedValid, $result->isValid(), 
$description );
}
diff --git a/repo/tests/phpunit/includes/content/EntityHandlerTest.php 
b/repo/tests/phpunit/includes/content/EntityHandlerTest.php
index 15b5d3a..2fac6a4 100644
--- a/repo/tests/phpunit/includes/content/EntityHandlerTest.php
+++ b/repo/tests/phpunit/includes/content/EntityHandlerTest.php
@@ -408,14 +408,6 @@
}
 
public function testExportTransform_neverRecodeNonLegacyFormat() {
-   $codec = $this->getMockBuilder( 
'Wikibase\Lib\Store\EntityContentDataCodec' )
-   ->disableOriginalConstructor()
-   ->getMock();
-   $codec->expects( $this->never() )
-   ->method( 'decodeEntity' );
-   $codec->expects( $this->never() )
-   ->method( 'encodeEntity' );
-
$settings = new SettingsArray();
$settings->setSetting( 'transformLegacyFormatOnExport', true );
 
@@ -423,7 +415,7 @@
$currentSerializer = $this->getWikibaseRepo( 

[MediaWiki-commits] [Gerrit] Remove dead arrgument from AddUsagesForPageJobTest - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250736

Change subject: Remove dead arrgument from AddUsagesForPageJobTest
..

Remove dead arrgument from AddUsagesForPageJobTest

Change-Id: I5d3616859262bc0dc14deb727abd6e0d8cd2c381
---
M client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php 
b/client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php
index 20b0fd0..a860faf 100644
--- a/client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php
+++ b/client/tests/phpunit/includes/store/AddUsagesForPageJobTest.php
@@ -153,7 +153,7 @@
$touched = '2015010100';
$usages = array( $usageQ5X );
 
-   $spec = AddUsagesForPageJob::newSpec( $title, $usages, 
$touched, 'es' );
+   $spec = AddUsagesForPageJob::newSpec( $title, $usages, $touched 
);
 
$expected = array(
'pageId' => $title->getArticleID(),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5d3616859262bc0dc14deb727abd6e0d8cd2c381
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250734

Change subject: Remove dead code
..

Remove dead code

Dead since 7e9afb6598acde776796639e9ca2102d0ff8860e

Change-Id: Ic0beb0f90446a7dc81c1e915c29800929f42a800
---
M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
1 file changed, 0 insertions(+), 38 deletions(-)


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

diff --git a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php 
b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
index f5f3dbc..50d72d7 100644
--- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
@@ -50,24 +50,6 @@
}
 
/**
-* @param EntityUsage[] $usages
-*
-* @return array
-*/
-   private function getItemIds( array $usages ) {
-   $ids = array();
-
-   foreach ( $usages as $usage ) {
-   $id = $usage->getEntityId();
-
-   $key = $id->getSerialization();
-   $ids[$key] = $id;
-   }
-
-   return $ids;
-   }
-
-   /**
 * @param int $pageId
 * @param EntityUsage[] $usages
 * @param string $touched timestamp
@@ -96,26 +78,6 @@
}
 
$rows[$key] = $row;
-   }
-
-   return $rows;
-   }
-
-   /**
-* @param array[] $rows
-* @param EntityId[] $entityIds
-*
-* @return array[]
-*/
-   private function removeRowsForEntities( array $rows, array $entityIds ) 
{
-   $idStrings = array_map( function ( EntityId $id ) {
-   return $id->getSerialization();
-   }, $entityIds );
-
-   foreach ( $rows as $key => $row ) {
-   if ( in_array( $row['eu_entity_id'], $idStrings ) ) {
-   unset( $rows[$key] );
-   }
}
 
return $rows;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0beb0f90446a7dc81c1e915c29800929f42a800
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove unused imports - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250731

Change subject: Remove unused imports
..

Remove unused imports

Change-Id: I1d80e06da47616eff6697f7b59ffcc04029fb1e5
---
M client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php
1 file changed, 0 insertions(+), 9 deletions(-)


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

diff --git a/client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php 
b/client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php
index 0e2ec6b..c7408c6 100644
--- a/client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php
+++ b/client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php
@@ -2,8 +2,6 @@
 
 namespace Wikibase\Client\Tests\Changes;
 
-use Diff\Differ\MapDiffer;
-use Diff\DiffOp\AtomicDiffOp;
 use Job;
 use JobQueueGroup;
 use PHPUnit_Framework_Assert;
@@ -13,13 +11,6 @@
 use Wikibase\Client\Changes\WikiPageUpdater;
 use Wikibase\Client\RecentChanges\RecentChangeFactory;
 use Wikibase\Client\RecentChanges\RecentChangesDuplicateDetector;
-use Wikibase\DataModel\Entity\EntityId;
-use Wikibase\DataModel\Entity\Item;
-use Wikibase\DataModel\Entity\ItemId;
-use Wikibase\DataModel\Services\Diff\EntityDiff;
-use Wikibase\DataModel\Services\Diff\EntityDiffer;
-use Wikibase\DataModel\Services\Diff\ItemDiffer;
-use Wikibase\DataModel\SiteLink;
 use Wikibase\EntityChange;
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d80e06da47616eff6697f7b59ffcc04029fb1e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove duplicate array element - change (mediawiki...Wikibase)

2015-11-03 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250726

Change subject: Remove duplicate array element
..

Remove duplicate array element

Change-Id: I9553e1e94aabbe6c09f2a2bd86051ae2147194eb
---
M repo/tests/phpunit/includes/store/sql/SqlChangeStoreTest.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/repo/tests/phpunit/includes/store/sql/SqlChangeStoreTest.php 
b/repo/tests/phpunit/includes/store/sql/SqlChangeStoreTest.php
index 3ddec9c..909acc5 100644
--- a/repo/tests/phpunit/includes/store/sql/SqlChangeStoreTest.php
+++ b/repo/tests/phpunit/includes/store/sql/SqlChangeStoreTest.php
@@ -38,7 +38,6 @@
 
$rc = new RecentChange();
$rc->setAttribs( array(
-   'rc_this_oldid' => 12,
'rc_user' => 34,
'rc_user_text' => 'BlackMagicIsEvil',
'rc_timestamp' => $time,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9553e1e94aabbe6c09f2a2bd86051ae2147194eb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Add jakub-onderka/php-parallel-lint package - change (mediawiki...Wikibase)

2015-11-02 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Add jakub-onderka/php-parallel-lint package
..


Add jakub-onderka/php-parallel-lint package

This will allow us to test php using composer.

This is a phplint test.

Change-Id: I29ae73e63701d3270df4de2cafc6c1309bd0c059
---
M composer.json
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/composer.json b/composer.json
index a6dcd49..c4cb032 100644
--- a/composer.json
+++ b/composer.json
@@ -46,6 +46,7 @@
"diff/diff": "~2.0"
},
"require-dev": {
+   "jakub-onderka/php-parallel-lint": "0.9",
"mediawiki/mediawiki-codesniffer": "0.4.0"
},
"conflict": {
@@ -74,6 +75,7 @@
},
"scripts": {
"test": [
+   "parallel-lint . --exclude vendor",
"composer cs"
],
"cs": [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I29ae73e63701d3270df4de2cafc6c1309bd0c059
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: JanZerebecki 
Gerrit-Reviewer: Jeroen De Dauw 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Remove cp error since tag - change (mediawiki...Wikibase)

2015-10-13 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245951

Change subject: Remove cp error since tag
..

Remove cp error since tag

Change-Id: I16756c0763f24687db4d275cff6bd4a353a0c79b
---
M lib/includes/changes/ChangeRow.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/lib/includes/changes/ChangeRow.php 
b/lib/includes/changes/ChangeRow.php
index f59c8fd..814a966 100644
--- a/lib/includes/changes/ChangeRow.php
+++ b/lib/includes/changes/ChangeRow.php
@@ -28,7 +28,6 @@
 * The fields of the object.
 * field name (w/o prefix) => value
 *
-* @since 1.20
 * @var array
 */
protected $fields = array( 'id' => null );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16756c0763f24687db4d275cff6bd4a353a0c79b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove not needed support for null in ChangeRow constructor - change (mediawiki...Wikibase)

2015-10-13 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245984

Change subject: Remove not needed support for null in ChangeRow constructor
..

Remove not needed support for null in ChangeRow constructor

Change-Id: I9b6963df74125facbb3c3dea525320970d9212e8
---
M lib/includes/changes/ChangeRow.php
M lib/includes/changes/EntityChangeFactory.php
2 files changed, 6 insertions(+), 11 deletions(-)


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

diff --git a/lib/includes/changes/ChangeRow.php 
b/lib/includes/changes/ChangeRow.php
index ad2058b..cdcd63b 100644
--- a/lib/includes/changes/ChangeRow.php
+++ b/lib/includes/changes/ChangeRow.php
@@ -65,11 +65,8 @@
return false;
}
 
-   /**
-* @param array|null $fields
-*/
-   public function __construct( array $fields = null ) {
-   $this->setFields( is_array( $fields ) ? $fields : array() );
+   public function __construct( array $fields = array() ) {
+   $this->setFields( $fields );
 
$this->postConstruct();
}
diff --git a/lib/includes/changes/EntityChangeFactory.php 
b/lib/includes/changes/EntityChangeFactory.php
index 8f33f3e..ee32cc2 100644
--- a/lib/includes/changes/EntityChangeFactory.php
+++ b/lib/includes/changes/EntityChangeFactory.php
@@ -61,7 +61,7 @@
 *
 * @return EntityChange
 */
-   public function newForEntity( $action, EntityId $entityId, array 
$fields = null ) {
+   public function newForEntity( $action, EntityId $entityId, array 
$fields = array() ) {
$entityType = $entityId->getEntityType();
 
if ( isset( $this->changeClasses[ $entityType ] ) ) {
@@ -71,9 +71,7 @@
}
 
/** @var EntityChange $instance  */
-   $instance = new $class(
-   $fields
-   );
+   $instance = new $class( $fields );
 
if ( !$instance->hasField( 'object_id' ) ) {
$instance->setField( 'object_id', 
$entityId->getSerialization() );
@@ -99,7 +97,7 @@
 * @param string  $action The action name
 * @param EntityDocument|null $oldEntity
 * @param EntityDocument|null $newEntity
-* @param array|null  $fields additional fields to set
+* @param array $fields additional fields to set
 *
 * @return EntityChange
 * @throws MWException
@@ -108,7 +106,7 @@
$action,
EntityDocument $oldEntity = null,
EntityDocument $newEntity = null,
-   array $fields = null
+   array $fields = array()
) {
if ( $oldEntity === null && $newEntity === null ) {
throw new MWException( 'Either $oldEntity or $newEntity 
must be given' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b6963df74125facbb3c3dea525320970d9212e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead field - change (mediawiki...Wikibase)

2015-10-13 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245979

Change subject: Remove dead field
..

Remove dead field

Change-Id: I77dc4c38ed571d752a027424ae09177d09661e22
---
M lib/includes/changes/ChangeRow.php
1 file changed, 0 insertions(+), 8 deletions(-)


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

diff --git a/lib/includes/changes/ChangeRow.php 
b/lib/includes/changes/ChangeRow.php
index ad2058b..83067bc 100644
--- a/lib/includes/changes/ChangeRow.php
+++ b/lib/includes/changes/ChangeRow.php
@@ -17,14 +17,6 @@
 class ChangeRow implements Change {
 
/**
-* Field for caching the linked user.
-*
-* @since 0.1
-* @var User|bool
-*/
-   private $user = false;
-
-   /**
 * The fields of the object.
 * field name (w/o prefix) => value
 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77dc4c38ed571d752a027424ae09177d09661e22
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove not needed post-construct stuff from ChangeRow - change (mediawiki...Wikibase)

2015-10-13 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245986

Change subject: Remove not needed post-construct stuff from ChangeRow
..

Remove not needed post-construct stuff from ChangeRow

Change-Id: I104c3fc3123788c7638af76066317c13e70110bf
---
M lib/includes/changes/ChangeRow.php
M lib/includes/changes/DiffChange.php
M lib/includes/changes/EntityChange.php
D lib/tests/phpunit/changes/DiffChangeTest.php
4 files changed, 1 insertion(+), 48 deletions(-)


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

diff --git a/lib/includes/changes/ChangeRow.php 
b/lib/includes/changes/ChangeRow.php
index cdcd63b..15d1765 100644
--- a/lib/includes/changes/ChangeRow.php
+++ b/lib/includes/changes/ChangeRow.php
@@ -67,17 +67,6 @@
 
public function __construct( array $fields = array() ) {
$this->setFields( $fields );
-
-   $this->postConstruct();
-   }
-
-   /**
-* @since 0.1
-*/
-   protected function postConstruct() {
-   if ( !$this->hasField( 'type' ) ) {
-   $this->setField( 'type', $this->getType() );
-   }
}
 
/**
diff --git a/lib/includes/changes/DiffChange.php 
b/lib/includes/changes/DiffChange.php
index 6c834b8..5be5718 100644
--- a/lib/includes/changes/DiffChange.php
+++ b/lib/includes/changes/DiffChange.php
@@ -14,7 +14,7 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Daniel Kinzler
  */
-class DiffChange extends ChangeRow {
+abstract class DiffChange extends ChangeRow {
 
/**
 * @since 0.1
diff --git a/lib/includes/changes/EntityChange.php 
b/lib/includes/changes/EntityChange.php
index b897338..6a664f4 100644
--- a/lib/includes/changes/EntityChange.php
+++ b/lib/includes/changes/EntityChange.php
@@ -146,13 +146,6 @@
}
 
/**
-* @see ChangeRow::postConstruct
-*/
-   protected function postConstruct() {
-   // This implementation should not set the type field.
-   }
-
-   /**
 * @param RecentChange $rc
 *
 * @todo rename to setRecentChangeInfo
diff --git a/lib/tests/phpunit/changes/DiffChangeTest.php 
b/lib/tests/phpunit/changes/DiffChangeTest.php
deleted file mode 100644
index 758c50c..000
--- a/lib/tests/phpunit/changes/DiffChangeTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
- * @author Daniel Kinzler
- */
-class DiffChangeTest extends ChangeRowTest {
-
-   /**
-* @since 0.4
-* @return string
-*/
-   protected function getRowClass() {
-   return '\Wikibase\DiffChange';
-   }
-
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I104c3fc3123788c7638af76066317c13e70110bf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Decrease field visibility - change (mediawiki...Wikibase)

2015-10-13 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245952

Change subject: Decrease field visibility
..

Decrease field visibility

Change-Id: I7e80f74d68894cf13cb5718bf4a3afaf03eaeb12
---
M lib/includes/changes/ChangeRow.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/lib/includes/changes/ChangeRow.php 
b/lib/includes/changes/ChangeRow.php
index 814a966..4216dbe 100644
--- a/lib/includes/changes/ChangeRow.php
+++ b/lib/includes/changes/ChangeRow.php
@@ -22,7 +22,7 @@
 * @since 0.1
 * @var User|bool
 */
-   protected $user = false;
+   private $user = false;
 
/**
 * The fields of the object.
@@ -30,7 +30,7 @@
 *
 * @var array
 */
-   protected $fields = array( 'id' => null );
+   private $fields = array( 'id' => null );
 
/**
 * @see Change::getUser

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e80f74d68894cf13cb5718bf4a3afaf03eaeb12
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove not needed parameters from ChangeRow constructor - change (mediawiki...Wikibase)

2015-10-13 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245953

Change subject: Remove not needed parameters from ChangeRow constructor
..

Remove not needed parameters from ChangeRow constructor

Change-Id: I2f353a90493f05c9980732513eafbc9ef4029653
---
M client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
M lib/includes/changes/ChangeRow.php
M lib/includes/changes/EntityChangeFactory.php
M lib/includes/store/sql/ChangeLookup.php
M lib/tests/phpunit/changes/ChangeRowTest.php
5 files changed, 5 insertions(+), 10 deletions(-)


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

diff --git a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php 
b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
index 2a96dab..426f657 100644
--- a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
+++ b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
@@ -130,7 +130,7 @@
$class = 'Wikibase\ItemChange';
}
 
-   $change = new $class( null, $values, false );
+   $change = new $class( $values );
$change->setDiff( $diff );
 
return $change;
diff --git a/lib/includes/changes/ChangeRow.php 
b/lib/includes/changes/ChangeRow.php
index 4216dbe..583c42a 100644
--- a/lib/includes/changes/ChangeRow.php
+++ b/lib/includes/changes/ChangeRow.php
@@ -81,10 +81,9 @@
}
 
/**
-* @param null $table Ignored
 * @param array|null $fields
 */
-   public function __construct( $table = null, $fields = null ) {
+   public function __construct( array $fields = null ) {
$this->setFields( is_array( $fields ) ? $fields : array() );
 
$this->postConstruct();
diff --git a/lib/includes/changes/EntityChangeFactory.php 
b/lib/includes/changes/EntityChangeFactory.php
index 7cf0525..8f33f3e 100644
--- a/lib/includes/changes/EntityChangeFactory.php
+++ b/lib/includes/changes/EntityChangeFactory.php
@@ -72,9 +72,7 @@
 
/** @var EntityChange $instance  */
$instance = new $class(
-   null,
-   $fields,
-   false
+   $fields
);
 
if ( !$instance->hasField( 'object_id' ) ) {
diff --git a/lib/includes/store/sql/ChangeLookup.php 
b/lib/includes/store/sql/ChangeLookup.php
index d233262..609de28 100644
--- a/lib/includes/store/sql/ChangeLookup.php
+++ b/lib/includes/store/sql/ChangeLookup.php
@@ -155,7 +155,7 @@
'revision_id' => $row->change_revision_id,
);
 
-   $changes[] = new $class( null, $data, false );
+   $changes[] = new $class( $data );
}
 
return $changes;
diff --git a/lib/tests/phpunit/changes/ChangeRowTest.php 
b/lib/tests/phpunit/changes/ChangeRowTest.php
index 59ab373..45b17ff 100644
--- a/lib/tests/phpunit/changes/ChangeRowTest.php
+++ b/lib/tests/phpunit/changes/ChangeRowTest.php
@@ -25,7 +25,6 @@
return array(
array(
new ChangeRow(
-   null,
array(
'user_id' => 1,
'time' => '2013010100'
@@ -65,8 +64,7 @@
}
 
public function testGetObjectId() {
-   $data = array( 'object_id' => 'p100' );
-   $change = new ChangeRow( null, $data );
+   $change = new ChangeRow( array( 'object_id' => 'p100' ) );
 
$this->assertEquals(
'p100',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f353a90493f05c9980732513eafbc9ef4029653
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove not used getUser - change (mediawiki...Wikibase)

2015-10-13 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245954

Change subject: Remove not used getUser
..

Remove not used getUser

Change-Id: Idab78ea098c766c8464c0512b418848568b9cc7f
---
M client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
M lib/includes/changes/ChangeRow.php
M lib/tests/phpunit/changes/ChangeRowTest.php
3 files changed, 0 insertions(+), 23 deletions(-)


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

diff --git a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php 
b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
index 426f657..21845c5 100644
--- a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
+++ b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
@@ -195,7 +195,6 @@
$this->assertEquals( $expected->getObjectId(), 
$actual->getObjectId(), $message . 'ObjectId' );
$this->assertEquals( $expected->getTime(), $actual->getTime(), 
$message . 'Time' );
$this->assertEquals( $expected->getType(), $actual->getType(), 
$message . 'Type' );
-   $this->assertEquals( $expected->getUser(), $actual->getUser(), 
$message . 'User' );
 
if ( $expected instanceof EntityChange && $actual instanceof 
EntityChange ) {
$this->assertEquals( $expected->getAction(), 
$actual->getAction(), $message . 'Action' );
diff --git a/lib/includes/changes/ChangeRow.php 
b/lib/includes/changes/ChangeRow.php
index 583c42a..ad2058b 100644
--- a/lib/includes/changes/ChangeRow.php
+++ b/lib/includes/changes/ChangeRow.php
@@ -33,21 +33,6 @@
private $fields = array( 'id' => null );
 
/**
-* @see Change::getUser
-*
-* @since 0.1
-*
-* @return User
-*/
-   public function getUser() {
-   if ( $this->user === false ) {
-   $this->user = User::newFromId( $this->getField( 
'user_id' ) );
-   }
-
-   return $this->user;
-   }
-
-   /**
 * @see Change::getAge
 *
 * @since 0.1
diff --git a/lib/tests/phpunit/changes/ChangeRowTest.php 
b/lib/tests/phpunit/changes/ChangeRowTest.php
index 45b17ff..3832e32 100644
--- a/lib/tests/phpunit/changes/ChangeRowTest.php
+++ b/lib/tests/phpunit/changes/ChangeRowTest.php
@@ -37,13 +37,6 @@
/**
 * @dataProvider changeProvider
 */
-   public function testGetUser( ChangeRow $changeRow ) {
-   $this->assertInstanceOf( '\User', $changeRow->getUser() );
-   }
-
-   /**
-* @dataProvider changeProvider
-*/
public function testGetAge( ChangeRow $changeRow ) {
// Don't assert on equalness because all previous code takes 
time!
$this->assertTrue(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idab78ea098c766c8464c0512b418848568b9cc7f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Improve method name and make checks explicit - change (mediawiki...Wikibase)

2015-10-12 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245482

Change subject: Improve method name and make checks explicit
..

Improve method name and make checks explicit

Change-Id: I21472c4b2274011056ee00337381305685eec16e
---
M repo/includes/LinkedData/EntityDataSerializationService.php
1 file changed, 9 insertions(+), 9 deletions(-)


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

diff --git a/repo/includes/LinkedData/EntityDataSerializationService.php 
b/repo/includes/LinkedData/EntityDataSerializationService.php
index 67155dd..c5bdccb 100644
--- a/repo/includes/LinkedData/EntityDataSerializationService.php
+++ b/repo/includes/LinkedData/EntityDataSerializationService.php
@@ -225,20 +225,20 @@
 
$serializer = $this->createApiSerializer( $formatName );
 
-   if ( $serializer ) {
-   $data = $this->apiSerialize( $entityRevision, 
$serializer );
+   if ( $serializer !== null ) {
+   $data = $this->getApiSerialization( $entityRevision, 
$serializer );
$contentType = $serializer->getIsHtml() ? 'text/html' : 
$serializer->getMimeType();
} else {
$rdfBuilder = $this->createRdfBuilder( $formatName, 
$flavor );
 
-   if ( !$rdfBuilder ) {
+   if ( $rdfBuilder === null ) {
throw new MWException( "Could not create 
serializer for $formatName" );
-   } else {
-   $data = $this->rdfSerialize( $entityRevision, 
$followedRedirect, $incomingRedirects, $rdfBuilder, $flavor );
-
-   $mimeTypes = 
$this->rdfWriterFactory->getMimeTypes( $formatName );
-   $contentType = reset( $mimeTypes );
}
+
+   $data = $this->rdfSerialize( $entityRevision, 
$followedRedirect, $incomingRedirects, $rdfBuilder, $flavor );
+
+   $mimeTypes = $this->rdfWriterFactory->getMimeTypes( 
$formatName );
+   $contentType = reset( $mimeTypes );
}
 
return array( $data, $contentType );
@@ -477,7 +477,7 @@
 *
 * @return string the serialized data
 */
-   private function apiSerialize(
+   private function getApiSerialization(
EntityRevision $entityRevision,
ApiFormatBase $printer
) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21472c4b2274011056ee00337381305685eec16e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Fix PHPDoc for apiSerialize - change (mediawiki...Wikibase)

2015-10-12 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245481

Change subject: Fix PHPDoc for apiSerialize
..

Fix PHPDoc for apiSerialize

Change-Id: I9329c79bcacfa8d769cf0916d3b6e566f3d409e7
---
M repo/includes/LinkedData/EntityDataSerializationService.php
1 file changed, 0 insertions(+), 2 deletions(-)


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

diff --git a/repo/includes/LinkedData/EntityDataSerializationService.php 
b/repo/includes/LinkedData/EntityDataSerializationService.php
index 5e78547..67155dd 100644
--- a/repo/includes/LinkedData/EntityDataSerializationService.php
+++ b/repo/includes/LinkedData/EntityDataSerializationService.php
@@ -473,8 +473,6 @@
 * expose internal implementation details.
 *
 * @param EntityRevision $entityRevision the entity to output.
-* @param EntityRedirect|null $followedRedirect a redirect leading to 
the entity for use in the output
-* @param EntityId[] $incomingRedirects Incoming redirects to include 
in the output
 * @param ApiFormatBase $printer the printer to use to generate the 
output
 *
 * @return string the serialized data

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9329c79bcacfa8d769cf0916d3b6e566f3d409e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove not needed state - change (mediawiki...Wikibase)

2015-10-12 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245602

Change subject: Remove not needed state
..

Remove not needed state

Change-Id: Ia611f09b29019c07d531bafa98142cb706b1b3e3
---
M repo/includes/store/sql/SqlChangeStore.php
1 file changed, 5 insertions(+), 11 deletions(-)


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

diff --git a/repo/includes/store/sql/SqlChangeStore.php 
b/repo/includes/store/sql/SqlChangeStore.php
index 2816989..b54a918 100644
--- a/repo/includes/store/sql/SqlChangeStore.php
+++ b/repo/includes/store/sql/SqlChangeStore.php
@@ -84,19 +84,13 @@
private function getValues( ChangeRow $change ) {
$fields = $change->getFields();
 
-   $time = isset( $fields['time'] ) ? $fields['time'] : 
wfTimestampNow();
-   $objectId = isset( $fields['object_id'] ) ? 
$fields['object_id'] : '';
-   $revId = isset( $fields['revision_id'] ) ? 
$fields['revision_id'] : '0';
-   $userId = isset( $fields['user_id'] ) ? $fields['user_id'] : 
'0';
-   $info = $change->serializeInfo( $fields['info'] );
-
return array(
'change_type' => $fields['type'],
-   'change_time' => $time,
-   'change_object_id' => $objectId,
-   'change_revision_id' => $revId,
-   'change_user_id' => $userId,
-   'change_info' => $info
+   'change_time' => isset( $fields['time'] ) ? 
$fields['time'] : wfTimestampNow(),
+   'change_object_id' => isset( $fields['object_id'] ) ? 
$fields['object_id'] : '',
+   'change_revision_id' => isset( $fields['revision_id'] ) 
? $fields['revision_id'] : '0',
+   'change_user_id' => isset( $fields['user_id'] ) ? 
$fields['user_id'] : '0',
+   'change_info' => $change->serializeInfo( 
$fields['info'] )
);
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia611f09b29019c07d531bafa98142cb706b1b3e3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Flip if else - change (mediawiki...Wikibase)

2015-10-12 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245601

Change subject: Flip if else
..

Flip if else

Change-Id: I1f4b2efe90be7dfc24296907d15e6a1e262ab161
---
M repo/includes/store/sql/SqlChangeStore.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/repo/includes/store/sql/SqlChangeStore.php 
b/repo/includes/store/sql/SqlChangeStore.php
index 2816989..ef4462c 100644
--- a/repo/includes/store/sql/SqlChangeStore.php
+++ b/repo/includes/store/sql/SqlChangeStore.php
@@ -41,10 +41,10 @@
public function saveChange( Change $change ) {
Assert::parameterType( 'Wikibase\ChangeRow', $change, '$change' 
);
 
-   if ( $change->getId() !== null ) {
-   $this->updateChange( $change );
-   } else {
+   if ( $change->getId() === null ) {
$this->insertChange( $change );
+   } else {
+   $this->updateChange( $change );
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f4b2efe90be7dfc24296907d15e6a1e262ab161
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove not needed and - change (mediawiki...WikibaseQualityExternalValidation)

2015-10-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/243491

Change subject: Remove not needed and
..

Remove not needed and

Change-Id: I06b99bc77318c03595377614ee75715031a60923
---
M includes/CrossCheck/Comparer/TimeValueComparer.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/CrossCheck/Comparer/TimeValueComparer.php 
b/includes/CrossCheck/Comparer/TimeValueComparer.php
index 2ea130c..d5f231c 100644
--- a/includes/CrossCheck/Comparer/TimeValueComparer.php
+++ b/includes/CrossCheck/Comparer/TimeValueComparer.php
@@ -79,7 +79,7 @@
 
switch ( $precision ) {
case TimeValue::PRECISION_SECOND:
-   $result = $result && $diff->s === 0;
+   $result = $diff->s === 0;
// Fall through with no break/return. This is 
critical for this algorithm.
case TimeValue::PRECISION_MINUTE:
$result = $result && $diff->i === 0;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I06b99bc77318c03595377614ee75715031a60923
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove redundant argument - change (mediawiki...WikibaseQualityExternalValidation)

2015-10-04 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/243490

Change subject: Remove redundant argument
..

Remove redundant argument

Change-Id: Ia74a7b828945e38578885e64d8c2b676695e5eae
---
M includes/CrossCheck/Comparer/TimeValueComparer.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/CrossCheck/Comparer/TimeValueComparer.php 
b/includes/CrossCheck/Comparer/TimeValueComparer.php
index 2ea130c..04117e8 100644
--- a/includes/CrossCheck/Comparer/TimeValueComparer.php
+++ b/includes/CrossCheck/Comparer/TimeValueComparer.php
@@ -46,7 +46,7 @@
// FIXME: MWTimestamp does not support years with more 
than 4 digits!
$localTimestamp = new MWTimestamp( substr( 
$value->getTime(), 1 ) );
$externalTimestamp = new MWTimestamp( substr( 
$comparativeValue->getTime(), 1 ) );
-   $diff = $localTimestamp->diff( $externalTimestamp, true 
);
+   $diff = $localTimestamp->diff( $externalTimestamp );
 
if ( $value->getPrecision() === 
$comparativeValue->getPrecision()
&& $this->resultOfDiffWithPrecision( $diff, 
$value->getPrecision() )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia74a7b828945e38578885e64d8c2b676695e5eae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Do not lose subtype exception info in RevisionBasedEntityLookup - change (mediawiki...Wikibase)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242766

Change subject: Do not lose subtype exception info in RevisionBasedEntityLookup
..

Do not lose subtype exception info in RevisionBasedEntityLookup

Change-Id: I5fd0c37e40370b451106d7f05d1efc0abf69609f
---
M lib/includes/store/RevisionBasedEntityLookup.php
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/lib/includes/store/RevisionBasedEntityLookup.php 
b/lib/includes/store/RevisionBasedEntityLookup.php
index 9008a5d..2dfc282 100644
--- a/lib/includes/store/RevisionBasedEntityLookup.php
+++ b/lib/includes/store/RevisionBasedEntityLookup.php
@@ -42,6 +42,8 @@
public function getEntity( EntityId $entityId ) {
try {
$revision = $this->lookup->getEntityRevision( $entityId 
);
+   } catch ( EntityLookupException $ex ) {
+   throw $ex;
} catch ( \Exception $ex ) {
// TODO: catch more specific exception once 
EntityRevisionLookup contract gets clarified
throw new EntityLookupException( $entityId, null, $ex );
@@ -61,6 +63,8 @@
public function hasEntity( EntityId $entityId ) {
try {
return $this->lookup->getLatestRevisionId( $entityId ) 
!== false;
+   } catch ( EntityLookupException $ex ) {
+   throw $ex;
} catch ( \Exception $ex ) {
// TODO: catch more specific exception once 
EntityRevisionLookup contract gets clarified
throw new EntityLookupException( $entityId, null, $ex );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fd0c37e40370b451106d7f05d1efc0abf69609f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Simplify switch case in resultOfDiffWithPrecision - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242796

Change subject: Simplify switch case in resultOfDiffWithPrecision
..

Simplify switch case in resultOfDiffWithPrecision

Change-Id: Ia11a7ddd421a1b04b9629d712818807200d232fe
---
M includes/CrossCheck/Comparer/TimeValueComparer.php
1 file changed, 28 insertions(+), 18 deletions(-)


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

diff --git a/includes/CrossCheck/Comparer/TimeValueComparer.php 
b/includes/CrossCheck/Comparer/TimeValueComparer.php
index 5825920..7dba46f 100644
--- a/includes/CrossCheck/Comparer/TimeValueComparer.php
+++ b/includes/CrossCheck/Comparer/TimeValueComparer.php
@@ -65,42 +65,52 @@
 * @return bool
 */
private function resultOfDiffWithPrecision( $diff, $precision ) {
-   $result = true;
switch ( $precision ) {
case TimeValue::PRECISION_MINUTE:
-   $result = $result && $diff->i === 0;
+   return $diff->i === 0;
+   break;
case TimeValue::PRECISION_HOUR:
-   $result = $result && $diff->h === 0;
+   return $diff->h === 0;
+   break;
case TimeValue::PRECISION_DAY:
-   $result = $result && $diff->d === 0;
+   return $diff->d === 0;
+   break;
case TimeValue::PRECISION_MONTH:
-   $result = $result && $diff->m === 0;
+   return $diff->m === 0;
+   break;
case TimeValue::PRECISION_YEAR:
-   $result = $result && $diff->y === 0;
+   return $diff->y === 0;
+   break;
case TimeValue::PRECISION_10a:
-   $result = $result && $diff->y < 10;
+   return $diff->y < 10;
+   break;
case TimeValue::PRECISION_100a:
-   $result = $result && $diff->y < 100;
+   return $diff->y < 100;
+   break;
case TimeValue::PRECISION_ka:
-   $result = $result && $diff->y < 1000;
+   return $diff->y < 1000;
+   break;
case TimeValue::PRECISION_10ka:
-   $result = $result && $diff->y < 1;
+   return $diff->y < 1;
+   break;
case TimeValue::PRECISION_100ka:
-   $result = $result && $diff->y < 10;
+   return $diff->y < 10;
+   break;
case TimeValue::PRECISION_Ma:
-   $result = $result && $diff->y < 100;
+   return $diff->y < 100;
+   break;
case TimeValue::PRECISION_10Ma:
-   $result = $result && $diff->y < 1000;
+   return $diff->y < 1000;
+   break;
case TimeValue::PRECISION_100Ma:
-   $result = $result && $diff->y < 1;
+   return $diff->y < 1;
+   break;
case TimeValue::PRECISION_Ga:
-   $result = $result && $diff->y < 10;
+   return $diff->y < 10;
break;
default:
-   $result = false;
+   return false;
}
-
-   return $result;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia11a7ddd421a1b04b9629d712818807200d232fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Renames as suggested by aude in https://gerrit.wikimedia.org... - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242785

Change subject: Renames as suggested by aude in 
https://gerrit.wikimedia.org/r/#/c/232279/8/includes/CrossCheck/CrossCheckInteractor.php
..

Renames as suggested by aude
in 
https://gerrit.wikimedia.org/r/#/c/232279/8/includes/CrossCheck/CrossCheckInteractor.php

Change-Id: Idc9709cc4fbbf63a626acd5c8ef356c81c099e0f
---
M includes/CrossCheck/CrossCheckInteractor.php
M specials/SpecialCrossCheck.php
M tests/phpunit/CrossCheck/CrossCheckInteractorTest.php
3 files changed, 9 insertions(+), 9 deletions(-)


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

diff --git a/includes/CrossCheck/CrossCheckInteractor.php 
b/includes/CrossCheck/CrossCheckInteractor.php
index effbfa5..bf77f07 100644
--- a/includes/CrossCheck/CrossCheckInteractor.php
+++ b/includes/CrossCheck/CrossCheckInteractor.php
@@ -60,7 +60,7 @@
$entity = $this->entityLookup->getEntity( $entityId );
 
if ( $entity instanceof StatementListProvider ) {
-   return $this->crossCheckEntity( 
$entity->getStatements() );
+   return $this->crossCheckStatementList( 
$entity->getStatements() );
}
 
return null;
@@ -91,7 +91,7 @@
 *
 * @return CrossCheckResultList
 */
-   public function crossCheckEntity( StatementList $statements ) {
+   public function crossCheckStatementList( StatementList $statements ) {
return $this->crossChecker->crossCheckStatements( $statements, 
$statements );
}
 
@@ -110,7 +110,7 @@
foreach ( $entities as $entity ) {
$entityId = $entity->getId()->getSerialization();
if ( $entity instanceof StatementListProvider ) {
-   $results[$entityId] = $this->crossCheckEntity( 
$entity->getStatements() );
+   $results[$entityId] = 
$this->crossCheckStatementList( $entity->getStatements() );
}
}
 
@@ -132,7 +132,7 @@
$entity = $this->entityLookup->getEntity( $entityId );
 
if ( $entity instanceof StatementListProvider ) {
-   return $this->crossCheckEntityWithProperties( 
$entity->getStatements(), $propertyIds );
+   return $this->crossCheckStatementsWithProperties( 
$entity->getStatements(), $propertyIds );
}
 
return null;
@@ -168,7 +168,7 @@
 * @return CrossCheckResultList
 * @throws InvalidArgumentException
 */
-   public function crossCheckEntityWithProperties( StatementList 
$entityStatements, array $propertyIds ) {
+   public function crossCheckStatementsWithProperties( StatementList 
$entityStatements, array $propertyIds ) {
Assert::parameterElementType( 
'Wikibase\DataModel\Entity\PropertyId',  $propertyIds, '$propertyIds' );
 
$statements = new StatementList();
@@ -198,7 +198,7 @@
foreach ( $entities as $entity ) {
$entityId = $entity->getId()->getSerialization();
if ( $entity instanceof StatementListProvider ) {
-   $results[$entityId] = 
$this->crossCheckEntityWithProperties(
+   $results[$entityId] = 
$this->crossCheckStatementsWithProperties(
$entity->getStatements(),
$propertyIds
);
diff --git a/specials/SpecialCrossCheck.php b/specials/SpecialCrossCheck.php
index c13294c..b7245cd 100644
--- a/specials/SpecialCrossCheck.php
+++ b/specials/SpecialCrossCheck.php
@@ -178,7 +178,7 @@
return;
}
 
-   $results = 
$this->crossCheckInteractor->crossCheckEntity( $entity->getStatements() );
+   $results = 
$this->crossCheckInteractor->crossCheckStatementList( $entity->getStatements() 
);
 
if ($results && count($results) > 0) {
$out->addHTML(
diff --git a/tests/phpunit/CrossCheck/CrossCheckInteractorTest.php 
b/tests/phpunit/CrossCheck/CrossCheckInteractorTest.php
index 662be47..c1d0094 100644
--- a/tests/phpunit/CrossCheck/CrossCheckInteractorTest.php
+++ b/tests/phpunit/CrossCheck/CrossCheckInteractorTest.php
@@ -179,7 +179,7 @@
 * @dataProvider crossCheckEntityDataProvider
 */
public function testCrossCheckEntity( StatementList $statements, array 
$expectedResult ) {
-   $actualResult = $this->crossCheckInteractor->crossCheckEntity( 
$statements );
+   $actualResult = 

[MediaWiki-commits] [Gerrit] Remove superfluous space - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242795

Change subject: Remove superfluous space
..

Remove superfluous space

Change-Id: Ic4496b04e57a9a6a634db5e05433963fedca48d5
---
M includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php 
b/includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php
index 41bba39..a0920ca 100644
--- a/includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php
+++ b/includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php
@@ -12,7 +12,7 @@
  * @author BP2014N1
  * @license GNU GPL v2+
  */
-class GlobeCoordinateValueComparer implements  DataValueComparer {
+class GlobeCoordinateValueComparer implements DataValueComparer {
 
/**
 * @see DataValueComparer::compare

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4496b04e57a9a6a634db5e05433963fedca48d5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove unused import - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242792

Change subject: Remove unused import
..

Remove unused import

Change-Id: Ie6ff6312a076e796f60e8500d4a478cb0dc5e767
---
M includes/CrossCheck/CrossChecker.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/includes/CrossCheck/CrossChecker.php 
b/includes/CrossCheck/CrossChecker.php
index def22ec..5c9399d 100644
--- a/includes/CrossCheck/CrossChecker.php
+++ b/includes/CrossCheck/CrossChecker.php
@@ -6,7 +6,6 @@
 use DataValues\StringValue;
 use InvalidArgumentException;
 use ValueParsers\ParseException;
-use Wikibase\DataModel\Entity\Entity;
 use Wikibase\DataModel\Entity\EntityIdValue;
 use Wikibase\DataModel\Entity\PropertyId;
 use Wikibase\DataModel\Services\Lookup\EntityLookup;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6ff6312a076e796f60e8500d4a478cb0dc5e767
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead local var - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242797

Change subject: Remove dead local var
..

Remove dead local var

Change-Id: If877fe50434c0695acc7b53002cb937fd8b49147
---
M tests/phpunit/CrossCheck/Comparer/MonolingualTextValueComparerTest.php
1 file changed, 0 insertions(+), 2 deletions(-)


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

diff --git 
a/tests/phpunit/CrossCheck/Comparer/MonolingualTextValueComparerTest.php 
b/tests/phpunit/CrossCheck/Comparer/MonolingualTextValueComparerTest.php
index 3b08aae..6b23b1a 100644
--- a/tests/phpunit/CrossCheck/Comparer/MonolingualTextValueComparerTest.php
+++ b/tests/phpunit/CrossCheck/Comparer/MonolingualTextValueComparerTest.php
@@ -49,8 +49,6 @@
}
 
public function comparisonProvider() {
-   $localValue = new MonolingualTextValue( 'en', 'foo' );
-
return array (
// Languages match
array (

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If877fe50434c0695acc7b53002cb937fd8b49147
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead function argument - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242798

Change subject: Remove dead function argument
..

Remove dead function argument

Change-Id: Iba01944a0a28079aabd6cdf7f6e24587df68cf82
---
M includes/CrossCheck/Comparer/TimeValueComparer.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/CrossCheck/Comparer/TimeValueComparer.php 
b/includes/CrossCheck/Comparer/TimeValueComparer.php
index 5825920..4f646c2 100644
--- a/includes/CrossCheck/Comparer/TimeValueComparer.php
+++ b/includes/CrossCheck/Comparer/TimeValueComparer.php
@@ -38,7 +38,7 @@
try {
$localTimestamp = new 
MWTimestamp(substr($value->getTime(), 1));
$externalTimestamp = new 
MWTimestamp(substr($comparativeValue->getTime(), 1));
-   $diff = $localTimestamp->diff( $externalTimestamp, true 
);
+   $diff = $localTimestamp->diff( $externalTimestamp );
 
if ( $value->getPrecision() === 
$comparativeValue->getPrecision()
&& $this->resultOfDiffWithPrecision( 
$diff, $value->getPrecision() ) ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba01944a0a28079aabd6cdf7f6e24587df68cf82
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove executable bits from files - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Remove executable bits from files
..


Remove executable bits from files

with exception of travis build bash scripts

Bug: T113751
Change-Id: Idf9d38f288a1cd3c54e21b31493052bb560fa0bf
---
M README.md
M WikibaseQualityExternalValidation.alias.php
M WikibaseQualityExternalValidation.php
M WikibaseQualityExternalValidationHooks.php
M api/RunCrossCheck.php
M build/travis/after_script.sh
M build/travis/before_script.sh
M build/travis/script.sh
M composer.json
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/DumpMetaInformation/DumpMetaInformation.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
M modules/ext.WikibaseExternalValidation.SpecialCrossCheckPage.css
M specials/SpecialCrossCheck.php
M specials/SpecialExternalDbs.php
M tests/phpunit/Api/RunCrossCheckTest.php
M tests/phpunit/CrossCheck/Comparer/DataValueComparerFactoryTest.php
M tests/phpunit/CrossCheck/Comparer/DataValueComparerTestBase.php
M tests/phpunit/CrossCheck/Comparer/DispatchingDataValueComparerTest.php
M tests/phpunit/CrossCheck/Comparer/EntityIdValueComparerTest.php
M tests/phpunit/CrossCheck/Comparer/GlobeCoordinateValueComparerTest.php
M tests/phpunit/CrossCheck/Comparer/MonolingualTextValueComparerTest.php
M tests/phpunit/CrossCheck/Comparer/MultilingualTextValueComparerTest.php
M tests/phpunit/CrossCheck/Comparer/QuantityValueComparerTest.php
M tests/phpunit/CrossCheck/Comparer/StringComparerTest.php
M tests/phpunit/CrossCheck/Comparer/StringValueComparerTest.php
M tests/phpunit/CrossCheck/Comparer/TimeValueComparerTest.php
M tests/phpunit/CrossCheck/CrossCheckInteractorTest.php
M tests/phpunit/CrossCheck/CrossCheckerTest.php
M tests/phpunit/CrossCheck/ReferenceCheckerTest.php
M tests/phpunit/CrossCheck/Result/ComparisonResultTest.php
M tests/phpunit/CrossCheck/Result/CrossCheckResultListTest.php
M tests/phpunit/CrossCheck/Result/CrossCheckResultTest.php
M tests/phpunit/CrossCheck/Result/ReferenceResultTest.php
M tests/phpunit/CrossCheck/ValueParser/ValueParserTestBase.php
M tests/phpunit/DumpMetaInformation/DumpMetaInformationTest.php
M tests/phpunit/DumpMetaInformation/SqlDumpMetaInformationRepoTest.php
M tests/phpunit/ExternalDataRepoTest.php
M tests/phpunit/ExternalValidationServicesTest.php
M tests/phpunit/Serializer/ComparisonResultSerializerTest.php
M tests/phpunit/Serializer/CrossCheckResultListSerializerTest.php
M tests/phpunit/Serializer/CrossCheckResultSerializerTest.php
M tests/phpunit/Serializer/DumpMetaInformationSerializerTest.php
M tests/phpunit/Serializer/ReferenceResultSerializerTest.php
M tests/phpunit/Serializer/SerializerFactoryTest.php
M tests/phpunit/Serializer/SerializerTestBase.php
M tests/phpunit/Specials/SpecialCrossCheckTest.php
M tests/phpunit/Specials/SpecialExternalDbsTest.php
M tests/phpunit/UpdateExternalData/CsvImportSettingsTest.php
M tests/phpunit/UpdateExternalData/UpdateExternalDataTest.php
79 files changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/README.md b/README.md
old mode 100755
new mode 100644
diff --git a/WikibaseQualityExternalValidation.alias.php 
b/WikibaseQualityExternalValidation.alias.php
old mode 100755
new mode 100644
diff --git a/WikibaseQualityExternalValidation.php 
b/WikibaseQualityExternalValidation.php
old mode 100755
new mode 100644
diff 

[MediaWiki-commits] [Gerrit] Seperate distinct value checks - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242786

Change subject: Seperate distinct value checks
..

Seperate distinct value checks

As partially suggted by aude in
https://gerrit.wikimedia.org/r/#/c/232279/8/specials/SpecialCrossCheck.php

Change-Id: I9425bd2bcd95151597dd7d3889cdf4853a2319cb
---
M specials/SpecialCrossCheck.php
1 file changed, 17 insertions(+), 3 deletions(-)


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

diff --git a/specials/SpecialCrossCheck.php b/specials/SpecialCrossCheck.php
index c13294c..c064357 100644
--- a/specials/SpecialCrossCheck.php
+++ b/specials/SpecialCrossCheck.php
@@ -12,6 +12,7 @@
 use Traversable;
 use ValueFormatters\FormatterOptions;
 use ValueFormatters\ValueFormatter;
+use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\DataModel\Entity\EntityIdParsingException;
@@ -171,16 +172,16 @@
return;
}
 
-   if ( !( $entity instanceof StatementListProvider ) ) {
+   if ( $entity === null ) {
$out->addHTML(

$this->buildNotice('wbqev-crosscheck-not-existent-entity', true)
);
return;
}
 
-   $results = 
$this->crossCheckInteractor->crossCheckEntity( $entity->getStatements() );
+   $results = $this->getCrossCheckResultsFromEntity( 
$entity );
 
-   if ($results && count($results) > 0) {
+   if ( count($results) > 0 ) {
$out->addHTML(
$this->buildResultHeader($entityId)
. $this->buildSummary($results)
@@ -196,6 +197,19 @@
}
 
/**
+* @param EntityDocument $entity
+*
+* @return CrossCheckResultList
+*/
+   private function getCrossCheckResultsFromEntity( EntityDocument $entity 
) {
+   if ( $entity instanceof StatementListProvider ) {
+   return $this->crossCheckInteractor->crossCheckEntity( 
$entity->getStatements() );
+   }
+
+   return new CrossCheckResultList();
+   }
+
+   /**
 * Builds html form for entity id input
 */
private function buildEntityIdForm() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9425bd2bcd95151597dd7d3889cdf4853a2319cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Add type hints to GlobeCoordinateValueComparer - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242794

Change subject: Add type hints to GlobeCoordinateValueComparer
..

Add type hints to GlobeCoordinateValueComparer

Change-Id: Id04994fd4d80038c1cbab8e73940d7a0f366b7d9
---
M includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php 
b/includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php
index 41bba39..5e53d25 100644
--- a/includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php
+++ b/includes/CrossCheck/Comparer/GlobeCoordinateValueComparer.php
@@ -26,6 +26,11 @@
throw new InvalidArgumentException( 'Given values can 
not be compared using this comparer.' );
}
 
+   /**
+* @var GlobeCoordinateValue $value
+* @var GlobeCoordinateValue $comparativeValue
+*/
+
$precision = $value->getPrecision();
$locLat = $value->getLatitude();
$locLong = $value->getLongitude();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id04994fd4d80038c1cbab8e73940d7a0f366b7d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Fix broken import after class got moved from lib to repo - change (mediawiki...WikibaseQualityExternalValidation)

2015-09-30 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242793

Change subject: Fix broken import after class got moved from lib to repo
..

Fix broken import after class got moved from lib to repo

Change-Id: Ie78b60565c9a29a7e8271808a9ad52f681cc19d2
---
M includes/CrossCheck/Comparer/TimeValueComparer.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/CrossCheck/Comparer/TimeValueComparer.php 
b/includes/CrossCheck/Comparer/TimeValueComparer.php
index 5825920..b888fb7 100644
--- a/includes/CrossCheck/Comparer/TimeValueComparer.php
+++ b/includes/CrossCheck/Comparer/TimeValueComparer.php
@@ -8,7 +8,7 @@
 use DataValues\TimeValue;
 use ValueParsers\ParserOptions;
 use ValueParsers\ValueParser;
-use Wikibase\Lib\Parsers\TimeParserFactory;
+use Wikibase\Repo\Parsers\TimeParserFactory;
 use WikibaseQuality\ExternalValidation\CrossCheck\Result\ComparisonResult;
 use WikibaseQuality\ExternalValidation\DumpMetaInformation\DumpMetaInformation;
 use MWTimestamp;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie78b60565c9a29a7e8271808a9ad52f681cc19d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove empty commend line - change (mediawiki...Wikibase)

2015-09-29 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242431

Change subject: Remove empty commend line
..

Remove empty commend line

Change-Id: I310af07b1ed899877a61bd8327281f2adf93a085
---
M lib/includes/store/EntityIdLookup.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/lib/includes/store/EntityIdLookup.php 
b/lib/includes/store/EntityIdLookup.php
index b33e963..fafb0f4 100644
--- a/lib/includes/store/EntityIdLookup.php
+++ b/lib/includes/store/EntityIdLookup.php
@@ -13,7 +13,6 @@
  *
  * @licence GNU GPL v2+
  * @author Daniel Kinzler
- *
  */
 interface EntityIdLookup {
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I310af07b1ed899877a61bd8327281f2adf93a085
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Revert "Replace deprecated $wgSpecialPageGroups" - change (mediawiki...SemanticWatchlist)

2015-09-25 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/241044

Change subject: Revert "Replace deprecated $wgSpecialPageGroups"
..

Revert "Replace deprecated $wgSpecialPageGroups"

This breaks compatibility with MediaWiki 1.19 and 1.20,
which are supported by this extension, as per README.

Please submit changes to this extension at
https://github.com/SemanticMediaWiki/SemanticWatchlist
so the CI runs before merge.

Legoktm: please do not abuse your merge rights here

This reverts commit f934497b3d8b170f6000f839ba0d2eb597d6e0ba.

Change-Id: Ib5c8681567c997fd0991a927dbf81d6ea20dc9e5
---
M SemanticWatchlist.php
M specials/SpecialSemanticWatchlist.php
M specials/SpecialWatchlistConditions.php
3 files changed, 2 insertions(+), 6 deletions(-)


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

diff --git a/SemanticWatchlist.php b/SemanticWatchlist.php
index 22d5f4c..c56f32d 100644
--- a/SemanticWatchlist.php
+++ b/SemanticWatchlist.php
@@ -70,8 +70,10 @@
 $GLOBALS['wgAutoloadClasses']['SpecialWatchlistConditions']= __DIR__ . 
'/specials/SpecialWatchlistConditions.php';
 
 $GLOBALS['wgSpecialPages']['SemanticWatchlist'] = 'SpecialSemanticWatchlist';
+$GLOBALS['wgSpecialPageGroups']['SemanticWatchlist'] = 'changes';
 
 $GLOBALS['wgSpecialPages']['WatchlistConditions'] = 
'SpecialWatchlistConditions';
+$GLOBALS['wgSpecialPageGroups']['WatchlistConditions'] = 'changes';
 
 $GLOBALS['wgAPIModules']['addswlgroup'] = 'ApiAddWatchlistGroup';
 $GLOBALS['wgAPIModules']['deleteswlgroup'] = 'ApiDeleteWatchlistGroup';
diff --git a/specials/SpecialSemanticWatchlist.php 
b/specials/SpecialSemanticWatchlist.php
index 5e68468..5312518 100644
--- a/specials/SpecialSemanticWatchlist.php
+++ b/specials/SpecialSemanticWatchlist.php
@@ -440,7 +440,4 @@
return $group !== false;
}
 
-   protected function getGroupName() {
-   return 'changes';
-   }
 }
diff --git a/specials/SpecialWatchlistConditions.php 
b/specials/SpecialWatchlistConditions.php
index b1c7fa6..3108172 100644
--- a/specials/SpecialWatchlistConditions.php
+++ b/specials/SpecialWatchlistConditions.php
@@ -135,7 +135,4 @@
);
}
 
-   protected function getGroupName() {
-   return 'changes';
-   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5c8681567c997fd0991a927dbf81d6ea20dc9e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticWatchlist
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Revert "Replace deprecated $wgSpecialPageGroups" - change (mediawiki...SemanticWatchlist)

2015-09-25 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Revert "Replace deprecated $wgSpecialPageGroups"
..


Revert "Replace deprecated $wgSpecialPageGroups"

This breaks compatibility with MediaWiki 1.19 and 1.20,
which are supported by this extension, as per README.

Please submit changes to this extension at
https://github.com/SemanticMediaWiki/SemanticWatchlist
so the CI runs before merge.

Legoktm: please do not abuse your merge rights here

This reverts commit f934497b3d8b170f6000f839ba0d2eb597d6e0ba.

Change-Id: Ib5c8681567c997fd0991a927dbf81d6ea20dc9e5
---
M SemanticWatchlist.php
M specials/SpecialSemanticWatchlist.php
M specials/SpecialWatchlistConditions.php
3 files changed, 2 insertions(+), 6 deletions(-)

Approvals:
  Jeroen De Dauw: Verified; Looks good to me, approved



diff --git a/SemanticWatchlist.php b/SemanticWatchlist.php
index 22d5f4c..c56f32d 100644
--- a/SemanticWatchlist.php
+++ b/SemanticWatchlist.php
@@ -70,8 +70,10 @@
 $GLOBALS['wgAutoloadClasses']['SpecialWatchlistConditions']= __DIR__ . 
'/specials/SpecialWatchlistConditions.php';
 
 $GLOBALS['wgSpecialPages']['SemanticWatchlist'] = 'SpecialSemanticWatchlist';
+$GLOBALS['wgSpecialPageGroups']['SemanticWatchlist'] = 'changes';
 
 $GLOBALS['wgSpecialPages']['WatchlistConditions'] = 
'SpecialWatchlistConditions';
+$GLOBALS['wgSpecialPageGroups']['WatchlistConditions'] = 'changes';
 
 $GLOBALS['wgAPIModules']['addswlgroup'] = 'ApiAddWatchlistGroup';
 $GLOBALS['wgAPIModules']['deleteswlgroup'] = 'ApiDeleteWatchlistGroup';
diff --git a/specials/SpecialSemanticWatchlist.php 
b/specials/SpecialSemanticWatchlist.php
index 5e68468..5312518 100644
--- a/specials/SpecialSemanticWatchlist.php
+++ b/specials/SpecialSemanticWatchlist.php
@@ -440,7 +440,4 @@
return $group !== false;
}
 
-   protected function getGroupName() {
-   return 'changes';
-   }
 }
diff --git a/specials/SpecialWatchlistConditions.php 
b/specials/SpecialWatchlistConditions.php
index b1c7fa6..3108172 100644
--- a/specials/SpecialWatchlistConditions.php
+++ b/specials/SpecialWatchlistConditions.php
@@ -135,7 +135,4 @@
);
}
 
-   protected function getGroupName() {
-   return 'changes';
-   }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib5c8681567c997fd0991a927dbf81d6ea20dc9e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticWatchlist
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 
Gerrit-Reviewer: Jeroen De Dauw 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Remove unused import - change (mediawiki...Wikibase)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240707

Change subject: Remove unused import
..

Remove unused import

Change-Id: I5c9063914579341cb313220ba0bf816e7d2b337e
---
M lib/tests/phpunit/store/EntityInfoTermLookupTest.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/lib/tests/phpunit/store/EntityInfoTermLookupTest.php 
b/lib/tests/phpunit/store/EntityInfoTermLookupTest.php
index 144dba6..d534860 100644
--- a/lib/tests/phpunit/store/EntityInfoTermLookupTest.php
+++ b/lib/tests/phpunit/store/EntityInfoTermLookupTest.php
@@ -4,7 +4,6 @@
 
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\ItemId;
-use Wikibase\DataModel\Services\Lookup\TermLookupException;
 use Wikibase\Lib\Store\EntityInfo;
 use Wikibase\Lib\Store\EntityInfoTermLookup;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c9063914579341cb313220ba0bf816e7d2b337e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove usage of deprecated EntityId::getNumericId - change (mediawiki...Wikibase)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240708

Change subject: Remove usage of deprecated EntityId::getNumericId
..

Remove usage of deprecated EntityId::getNumericId

Change-Id: I2819f184c0b913f50dcc070bf225c0e45f52dc8a
---
M lib/tests/phpunit/formatters/VocabularyUriFormatterTest.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/lib/tests/phpunit/formatters/VocabularyUriFormatterTest.php 
b/lib/tests/phpunit/formatters/VocabularyUriFormatterTest.php
index 900c5b2..1f892c6 100644
--- a/lib/tests/phpunit/formatters/VocabularyUriFormatterTest.php
+++ b/lib/tests/phpunit/formatters/VocabularyUriFormatterTest.php
@@ -43,7 +43,7 @@
$labelLookup->expects( $this->any() )
->method( 'getLabel' )
->will( $this->returnCallback( function( EntityId $id ) 
{
-   if ( $id->getNumericId() > 1000 ) {
+   if ( $id->getSerialization() === 'Q112233' ) {
throw new 
LabelDescriptionLookupException( $id, 'No such label!' );
}
return new Term( 'en', 'LABEL:' . 
$id->getSerialization() );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2819f184c0b913f50dcc070bf225c0e45f52dc8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Make RevisionBasedEntityLookup adhere to its interfaces cont... - change (mediawiki...Wikibase)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240712

Change subject: Make RevisionBasedEntityLookup adhere to its interfaces contract
..

Make RevisionBasedEntityLookup adhere to its interfaces contract

Change-Id: I7f185228740d6d14a4a7940db15fe07c14920aa1
---
M lib/includes/store/RevisionBasedEntityLookup.php
1 file changed, 17 insertions(+), 6 deletions(-)


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

diff --git a/lib/includes/store/RevisionBasedEntityLookup.php 
b/lib/includes/store/RevisionBasedEntityLookup.php
index 868fc89..9008a5d 100644
--- a/lib/includes/store/RevisionBasedEntityLookup.php
+++ b/lib/includes/store/RevisionBasedEntityLookup.php
@@ -5,6 +5,7 @@
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Services\Lookup\EntityLookup;
+use Wikibase\DataModel\Services\Lookup\EntityLookupException;
 
 /**
  * An implementation of EntityLookup based on an EntityRevisionLookup.
@@ -35,12 +36,18 @@
 *
 * @param EntityId $entityId
 *
-* @throws StorageException
+* @throws EntityLookupException
 * @return EntityDocument|null
 */
public function getEntity( EntityId $entityId ) {
-   $revision = $this->lookup->getEntityRevision( $entityId );
-   return ( $revision === null ) ? null : $revision->getEntity();
+   try {
+   $revision = $this->lookup->getEntityRevision( $entityId 
);
+   } catch ( \Exception $ex ) {
+   // TODO: catch more specific exception once 
EntityRevisionLookup contract gets clarified
+   throw new EntityLookupException( $entityId, null, $ex );
+   }
+
+   return $revision === null ? null : $revision->getEntity();
}
 
/**
@@ -48,12 +55,16 @@
 *
 * @param EntityId $entityId
 *
-* @throws StorageException
+* @throws EntityLookupException
 * @return bool
 */
public function hasEntity( EntityId $entityId ) {
-   return $this->lookup->getLatestRevisionId( $entityId ) !== 
false;
-
+   try {
+   return $this->lookup->getLatestRevisionId( $entityId ) 
!== false;
+   } catch ( \Exception $ex ) {
+   // TODO: catch more specific exception once 
EntityRevisionLookup contract gets clarified
+   throw new EntityLookupException( $entityId, null, $ex );
+   }
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f185228740d6d14a4a7940db15fe07c14920aa1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Make WikiPageEntityRedirectLookup adhere to its interfaces c... - change (mediawiki...Wikibase)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240723

Change subject: Make WikiPageEntityRedirectLookup adhere to its interfaces 
contract
..

Make WikiPageEntityRedirectLookup adhere to its interfaces contract

Change-Id: I9c1ea664a37dcc2293550dce52154385550bfd01
---
M lib/tests/phpunit/MockRepositoryTest.php
M repo/includes/Interactors/RedirectCreationInteractor.php
M repo/includes/LinkedData/EntityDataRequestHandler.php
M repo/includes/store/sql/WikiPageEntityRedirectLookup.php
M repo/tests/phpunit/includes/store/sql/WikiPageEntityRedirectLookupTest.php
M repo/tests/phpunit/includes/store/sql/WikiPageEntityStoreTest.php
6 files changed, 72 insertions(+), 32 deletions(-)


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

diff --git a/lib/tests/phpunit/MockRepositoryTest.php 
b/lib/tests/phpunit/MockRepositoryTest.php
index d6297ba..233fad7 100644
--- a/lib/tests/phpunit/MockRepositoryTest.php
+++ b/lib/tests/phpunit/MockRepositoryTest.php
@@ -729,9 +729,14 @@
$mock->putEntity( new Item( $q5 ) );
$mock->putRedirect( new EntityRedirect( $q55, $q5 ) );
 
-   $this->assertFalse( $mock->getRedirectForEntityId( $q77 ), 
'unknown id' );
$this->assertNull( $mock->getRedirectForEntityId( $q5 ), 'not a 
redirect' );
$this->assertEquals( $q5, $mock->getRedirectForEntityId( $q55 ) 
);
+
+   $this->setExpectedException(
+   
'Wikibase\DataModel\Services\Lookup\EntityRedirectLookupException',
+   'unknown id'
+   );
+   $mock->getRedirectForEntityId( $q77 );
}
 
 }
diff --git a/repo/includes/Interactors/RedirectCreationInteractor.php 
b/repo/includes/Interactors/RedirectCreationInteractor.php
index df7d710..7418b25 100644
--- a/repo/includes/Interactors/RedirectCreationInteractor.php
+++ b/repo/includes/Interactors/RedirectCreationInteractor.php
@@ -6,6 +6,7 @@
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\EntityRedirect;
 use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup;
+use Wikibase\DataModel\Services\Lookup\EntityRedirectLookupException;
 use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Lib\Store\EntityStore;
 use Wikibase\Lib\Store\StorageException;
@@ -192,17 +193,21 @@
 * @throws RedirectCreationException
 */
private function checkExistsNoRedirect( EntityId $entityId ) {
-   $redirect = $this->entityRedirectLookup->getRedirectForEntityId(
-   $entityId,
-   'for update'
-   );
-
-   if ( $redirect === false ) {
-   throw new RedirectCreationException(
-   "Entity $entityId not found",
-   'no-such-entity'
+   try {
+   $redirect = 
$this->entityRedirectLookup->getRedirectForEntityId(
+   $entityId,
+   'for update'
);
-   } elseif ( $redirect !== null ) {
+   }
+   catch ( EntityRedirectLookupException $ex ) {
+   throw new RedirectCreationException(
+   $ex->getMessage(),
+   'no-such-entity',
+   $ex
+   );
+   }
+
+   if ( $redirect !== null ) {
throw new RedirectCreationException(
"Entity $entityId is a redirect",
'target-is-redirect'
diff --git a/repo/includes/LinkedData/EntityDataRequestHandler.php 
b/repo/includes/LinkedData/EntityDataRequestHandler.php
index 4d1eac8..2bbb89d 100644
--- a/repo/includes/LinkedData/EntityDataRequestHandler.php
+++ b/repo/includes/LinkedData/EntityDataRequestHandler.php
@@ -12,6 +12,7 @@
 use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\DataModel\Entity\EntityIdParsingException;
 use Wikibase\DataModel\Services\Lookup\EntityRedirectLookup;
+use Wikibase\DataModel\Services\Lookup\EntityRedirectLookupException;
 use Wikibase\EntityRevision;
 use Wikibase\Lib\Store\BadRevisionException;
 use Wikibase\Lib\Store\EntityRevisionLookup;
@@ -399,7 +400,7 @@
private function getIncomingRedirects( EntityId $id ) {
try {
return $this->entityRedirectLookup->getRedirectIds( $id 
);
-   } catch ( StorageException $ex ) {
+   } catch ( EntityRedirectLookupException $ex ) {
$prefixedId = $id->getSerialization();
wfDebugLog( __CLASS__, __FUNCTION__ . ": failed to load 
incoming redirects of $prefixedId: $ex" );
return array();

[MediaWiki-commits] [Gerrit] Remove dead code in SpecialNewEntity - change (mediawiki...Wikibase)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240737

Change subject: Remove dead code in SpecialNewEntity
..

Remove dead code in SpecialNewEntity

Change-Id: I290dadf4c250be6730071dbba58886730f555c92
---
M repo/includes/specials/SpecialNewEntity.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/repo/includes/specials/SpecialNewEntity.php 
b/repo/includes/specials/SpecialNewEntity.php
index a5d9e42..c8ac174 100644
--- a/repo/includes/specials/SpecialNewEntity.php
+++ b/repo/includes/specials/SpecialNewEntity.php
@@ -246,7 +246,6 @@
$this->getOutput()->addModules( 
'wikibase.special.languageLabelDescriptionAliases' );
 
$langCode = $this->contentLanguage->getCode();
-   $langName = Language::fetchLanguageName( $langCode );
$langDir = $this->contentLanguage->getDir();
return array(
'lang' => array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I290dadf4c250be6730071dbba58886730f555c92
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] PhpStorm says this is better - change (mediawiki...Wikibase)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240738

Change subject: PhpStorm says this is better
..

PhpStorm says this is better

Change-Id: I0c6cc07c1a26e6e58cb7ebf1869ef20d7ccaf46f
---
M repo/resources/wikibase.ui.entityViewInit.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/repo/resources/wikibase.ui.entityViewInit.js 
b/repo/resources/wikibase.ui.entityViewInit.js
index 9eefbd6..8db03c7 100644
--- a/repo/resources/wikibase.ui.entityViewInit.js
+++ b/repo/resources/wikibase.ui.entityViewInit.js
@@ -161,7 +161,7 @@
function updateWatchLink() {
// All four supported skins are using the same ID, the 
other selectors
// in mediawiki.page.watch.ajax.js are undocumented and 
probably legacy stuff
-   var $link = $( '#ca-watch a' );
+   var $link = $( '#ca-watch' ).find( 'a' );
 
// Skip if page is already watched and there is no 
"watch this page" link
// Note: The exposed function fails for empty jQuery 
collections

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c6cc07c1a26e6e58cb7ebf1869ef20d7ccaf46f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Split method in HtmlTableBuilder - change (mediawiki...WikibaseQuality)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240768

Change subject: Split method in HtmlTableBuilder
..

Split method in HtmlTableBuilder

Also swap out imperative programming for a more functional approach

Change-Id: Ic92adce1fe84bd96d2f576d47159a83d739ca9cd
---
A includes/Html/HtmlSerializable.php
M includes/Html/HtmlTableBuilder.php
M includes/Html/HtmlTableCellBuilder.php
M includes/Html/HtmlTableHeaderBuilder.php
4 files changed, 56 insertions(+), 27 deletions(-)


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

diff --git a/includes/Html/HtmlSerializable.php 
b/includes/Html/HtmlSerializable.php
new file mode 100644
index 000..2cbac28
--- /dev/null
+++ b/includes/Html/HtmlSerializable.php
@@ -0,0 +1,16 @@
+
+ */
+interface HtmlSerializable {
+
+   /**
+* @return string
+*/
+   public function toHtml();
+
+}
\ No newline at end of file
diff --git a/includes/Html/HtmlTableBuilder.php 
b/includes/Html/HtmlTableBuilder.php
index 2123a33..5315cec 100755
--- a/includes/Html/HtmlTableBuilder.php
+++ b/includes/Html/HtmlTableBuilder.php
@@ -119,42 +119,55 @@
 * @return string
 */
public function toHtml() {
-   // Open table
+   return $this->getTableOpeningHtml()
+   . $this->getTableHeaderHtml()
+   . $this->getTableRowHtml()
+   . Html::closeElement( 'table' );
+   }
+
+   private function getTableOpeningHtml() {
$tableClasses = 'wikitable';
+
if ( $this->isSortable ) {
$tableClasses .= ' sortable jquery-tablesort';
}
-   $html = Html::openElement(
+
+   return Html::openElement(
'table',
array(
'class' => $tableClasses
)
);
+   }
 
-   // Write headers
-   $html .= Html::openElement( 'tr' );
-   foreach ( $this->headers as $header ) {
-   $html .= $header->toHtml();
-   }
-   $html .= Html::closeElement( 'tr' );
+   private function getTableHeaderHtml() {
+   return $this->getHtmlSerializablesInRow( $this->headers );
+   }
 
-   // Write rows
-   foreach ( $this->rows as $row ) {
-   $html .= Html::openElement( 'tr' );
+   /**
+* @param HtmlSerializable[] $serializables
+* @return string
+*/
+   private function getHtmlSerializablesInRow( array $serializables ) {
+   return Html::rawElement(
+   'tr',
+   array(),
+   implode( '', array_map(
+   function( HtmlSerializable $header ) {
+   return $header->toHtml();
+   },
+   $serializables
+   ) )
+   );
+   }
 
-   /**
-* @var HtmlTableCellBuilder $cell
-*/
-   foreach ( $row as $cell ) {
-   $html .= $cell->toHtml();
-   }
-
-   $html .= Html::closeElement( 'tr' );
-   }
-
-   // Close table
-   $html .= Html::closeElement( 'table' );
-
-   return $html;
+   private function getTableRowHtml() {
+   $self = $this;
+   return implode( '', array_map(
+   function( array $row ) use ( $self ) {
+   return $self->getHtmlSerializablesInRow( $row );
+   },
+   $this->rows
+   ) );
}
 }
\ No newline at end of file
diff --git a/includes/Html/HtmlTableCellBuilder.php 
b/includes/Html/HtmlTableCellBuilder.php
index c840949..fe0b715 100755
--- a/includes/Html/HtmlTableCellBuilder.php
+++ b/includes/Html/HtmlTableCellBuilder.php
@@ -10,7 +10,7 @@
  * @author BP2014N1
  * @license GNU GPL v2+
  */
-class HtmlTableCellBuilder {
+class HtmlTableCellBuilder implements HtmlSerializable {
 
/**
 * Html content of the cell.
diff --git a/includes/Html/HtmlTableHeaderBuilder.php 
b/includes/Html/HtmlTableHeaderBuilder.php
index 6814278..aa97dd9 100755
--- a/includes/Html/HtmlTableHeaderBuilder.php
+++ b/includes/Html/HtmlTableHeaderBuilder.php
@@ -10,7 +10,7 @@
  * @author BP2014N1
  * @license GNU GPL v2+
  */
-class HtmlTableHeaderBuilder {
+class HtmlTableHeaderBuilder implements HtmlSerializable {
 
/**
 * Html content of the header

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] Add type hint - change (mediawiki...WikibaseQuality)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240767

Change subject: Add type hint
..

Add type hint

Change-Id: I30b3907168d81738695e5d867a4a7143543a3789
---
M includes/Html/HtmlTableBuilder.php
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQuality 
refs/changes/67/240767/1

diff --git a/includes/Html/HtmlTableBuilder.php 
b/includes/Html/HtmlTableBuilder.php
index 3a92ef0..2123a33 100755
--- a/includes/Html/HtmlTableBuilder.php
+++ b/includes/Html/HtmlTableBuilder.php
@@ -18,7 +18,9 @@
private $headers = array();
 
/**
-* @var array
+* Array of HtmlTableCellBuilder arrays
+*
+* @var array[]
 */
private $rows = array();
 
@@ -139,9 +141,14 @@
// Write rows
foreach ( $this->rows as $row ) {
$html .= Html::openElement( 'tr' );
+
+   /**
+* @var HtmlTableCellBuilder $cell
+*/
foreach ( $row as $cell ) {
$html .= $cell->toHtml();
}
+
$html .= Html::closeElement( 'tr' );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I30b3907168d81738695e5d867a4a7143543a3789
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQuality
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove unused code in DirectSqlStore - change (mediawiki...Wikibase)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240739

Change subject: Remove unused code in DirectSqlStore
..

Remove unused code in DirectSqlStore

Change-Id: I6ece5de72391fc07ef8895639fca7987abb28a0b
---
M client/includes/store/sql/DirectSqlStore.php
1 file changed, 0 insertions(+), 2 deletions(-)


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

diff --git a/client/includes/store/sql/DirectSqlStore.php 
b/client/includes/store/sql/DirectSqlStore.php
index 6eb099a..5af536f 100644
--- a/client/includes/store/sql/DirectSqlStore.php
+++ b/client/includes/store/sql/DirectSqlStore.php
@@ -434,8 +434,6 @@
 */
public function getPropertyInfoStore() {
if ( $this->propertyInfoTable === null ) {
-   $wikibaseClient = WikibaseClient::getDefaultInstance();
-
$propertyInfoStore = new PropertyInfoTable( true, 
$this->repoWiki );
$cacheKey = $this->cacheKeyPrefix . 
':CachingPropertyInfoStore';
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ece5de72391fc07ef8895639fca7987abb28a0b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead code - change (mediawiki/core)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240746

Change subject: Remove dead code
..

Remove dead code

Change-Id: Iafcb15a8843889bf7fbfb191b64d86e9f8561185
---
M includes/api/ApiQueryDeletedRevisions.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/240746/1

diff --git a/includes/api/ApiQueryDeletedRevisions.php 
b/includes/api/ApiQueryDeletedRevisions.php
index bf48b19..fa1dfc2 100644
--- a/includes/api/ApiQueryDeletedRevisions.php
+++ b/includes/api/ApiQueryDeletedRevisions.php
@@ -46,7 +46,6 @@
);
}
 
-   $result = $this->getResult();
$pageSet = $this->getPageSet();
$pageMap = $pageSet->getGoodAndMissingTitlesByNamespace();
$pageCount = count( $pageSet->getGoodAndMissingTitles() );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafcb15a8843889bf7fbfb191b64d86e9f8561185
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove unused $pageSet var - change (mediawiki/core)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240747

Change subject: Remove unused $pageSet var
..

Remove unused $pageSet var

Change-Id: Ic9c8bf9ed840703128a4c0e873ef7d70b6155494
---
M includes/api/ApiQueryAllDeletedRevisions.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/240747/1

diff --git a/includes/api/ApiQueryAllDeletedRevisions.php 
b/includes/api/ApiQueryAllDeletedRevisions.php
index 172ee99..4f7984e6 100644
--- a/includes/api/ApiQueryAllDeletedRevisions.php
+++ b/includes/api/ApiQueryAllDeletedRevisions.php
@@ -54,7 +54,6 @@
$params = $this->extractRequestParams( false );
 
$result = $this->getResult();
-   $pageSet = $this->getPageSet();
 
// This module operates in two modes:
// 'user': List deleted revs by a certain user

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9c8bf9ed840703128a4c0e873ef7d70b6155494
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove dead argument - change (mediawiki/core)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240748

Change subject: Remove dead argument
..

Remove dead argument

Change-Id: Icd1584460e68422e50d4391bfbdf0d938ab1c1cf
---
M includes/actions/RollbackAction.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/48/240748/1

diff --git a/includes/actions/RollbackAction.php 
b/includes/actions/RollbackAction.php
index 93669cf..70d7d16 100644
--- a/includes/actions/RollbackAction.php
+++ b/includes/actions/RollbackAction.php
@@ -109,7 +109,7 @@
$this->getOutput()->returnToMain( false, $this->getTitle() );
 
if ( !$request->getBool( 'hidediff', false ) &&
-   !$this->getUser()->getBoolOption( 'norollbackdiff', 
false )
+   !$this->getUser()->getBoolOption( 'norollbackdiff' )
) {
$contentHandler = $current->getContentHandler();
$de = $contentHandler->createDifferenceEngine(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd1584460e68422e50d4391bfbdf0d938ab1c1cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Remove unused argument - change (mediawiki/core)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240751

Change subject: Remove unused argument
..

Remove unused argument

Change-Id: I7e7cf2b1f99834a140d0213c39cc67cfbc481ec9
---
M includes/db/DatabaseMysqlBase.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/240751/1

diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index 1f87055..160c354 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -138,7 +138,7 @@
 
if ( $set ) {
// Use doQuery() to avoid opening implicit transactions 
(DBO_TRX)
-   $success = $this->doQuery( 'SET ' . implode( ', ', $set 
), __METHOD__ );
+   $success = $this->doQuery( 'SET ' . implode( ', ', $set 
) );
if ( !$success ) {
wfLogDBError(
'Error setting MySQL variables on 
server {db_server} (check $wgSQLMode)',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e7cf2b1f99834a140d0213c39cc67cfbc481ec9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Fix mistake caused by fail method name - change (mediawiki/core)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240752

Change subject: Fix mistake caused by fail method name
..

Fix mistake caused by fail method name

Change-Id: I8b7706ebb823f08e16867e96436dc1b022f1e36b
---
M includes/specials/SpecialListfiles.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/52/240752/1

diff --git a/includes/specials/SpecialListfiles.php 
b/includes/specials/SpecialListfiles.php
index 2d79aaf..3ea56c6 100644
--- a/includes/specials/SpecialListfiles.php
+++ b/includes/specials/SpecialListfiles.php
@@ -52,7 +52,7 @@
if ( $this->including() ) {
$out->addParserOutputContent( $pager->getBodyOutput() );
} else {
-   $out->addHTML( $pager->getForm() );
+   $pager->getForm();
$out->addParserOutputContent( $pager->getFullOutput() );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b7706ebb823f08e16867e96436dc1b022f1e36b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


[MediaWiki-commits] [Gerrit] Fix type hint in unprefixRow - change (mediawiki/core)

2015-09-24 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240754

Change subject: Fix type hint in unprefixRow
..

Fix type hint in unprefixRow

Change-Id: Iba80cadfdb06b3f9b3f5a6e1d367260405bea1d0
---
M includes/filerepo/file/LocalFile.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/240754/1

diff --git a/includes/filerepo/file/LocalFile.php 
b/includes/filerepo/file/LocalFile.php
index d2c37e6..4c9c2aa 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -456,7 +456,7 @@
}
 
/**
-* @param array $row Row
+* @param array|object $row
 * @param string $prefix
 * @throws MWException
 * @return array

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba80cadfdb06b3f9b3f5a6e1d367260405bea1d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 

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


  1   2   3   4   5   6   7   8   9   10   >