[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Use backticks in HISTORY.md

2017-12-18 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399118 )

Change subject: Use backticks in HISTORY.md
..

Use backticks in HISTORY.md

Text within double underscores is otherwise rendered as bold.

Change-Id: I0a18e7018f2c8b6032f8f80d85c1e0872ae592de
---
M HISTORY.md
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/HISTORY.md b/HISTORY.md
index e45b592..4088663 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -163,7 +163,7 @@
 * Add IfElseStructureSniff to handle else structures (TasneemLo)
 * Handle multiple # comments in Space Before Comment (TasneemLo)
 * Sniff to check assignment in while & if (TasneemLo)
-* Sniff to warn when using dirname(__FILE__) (TasneemLo)
+* Sniff to warn when using `dirname(__FILE__)` (TasneemLo)
 
 ## 0.4.0 / 2015-09-26 ##
 * Use upstream codesniffer 2.3.4 (Kunal Mehta & Paladox)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a18e7018f2c8b6032f8f80d85c1e0872ae592de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Replace PEAR with Packagist in README.md link

2017-12-18 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398945 )

Change subject: Replace PEAR with Packagist in README.md link
..

Replace PEAR with Packagist in README.md link

Compare with commit 83b4ab6bb9720393185bdfa691d4448a9ed759c6
which made installation instructions use Composer.

Change-Id: Ie77281e69371fe45d927cb9f877d507e11903c0c
---
M README.md
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/README.md b/README.md
index 3f370c2..0be5bc9 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,6 @@
 * Migrate the old code-utils/check-vars.php
 
 ---
-[0]: https://pear.php.net/package/PHP_CodeSniffer
+[0]: https://packagist.org/packages/squizlabs/php_codesniffer
 [1]: https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP
 [2]: https://www.mediawiki.org/wiki/Continuous_integration/Entry_points#PHP

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie77281e69371fe45d927cb9f877d507e11903c0c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Update PHP_CodeSniffer to 3.2.0

2017-12-13 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398050 )

Change subject: Update PHP_CodeSniffer to 3.2.0
..

Update PHP_CodeSniffer to 3.2.0

Introducing the new comment syntax, whereby e.g.
@codingStandardsIgnoreLine becomes phpcs:ignore,
and it is now possible to ignore specific sniffs.

https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.2.0

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


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

diff --git a/composer.json b/composer.json
index 2b94393..172201f 100644
--- a/composer.json
+++ b/composer.json
@@ -6,7 +6,7 @@
"license": "GPL-2.0+",
"require": {
"php": ">= 5.5.9",
-   "squizlabs/php_codesniffer": "3.1.1"
+   "squizlabs/php_codesniffer": "3.2.0"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58c2b83bc2fe17bd8f289de88059d0eeb37ea480
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] analytics...web[master]: Load Open Sans from fontcdn

2017-08-11 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371514 )

Change subject: Load Open Sans from fontcdn
..

Load Open Sans from fontcdn

As a side effect, browsers that support unicode-range will automatically
download and use font files for additional subsets (e.g. cyrillic, greek)
if needed.

Change-Id: I28d78a1d5a4525b6a3e433d278a7c51c37338b08
---
D quarry/web/static/css/fonts.css
D quarry/web/static/fonts/open-sans-bold-italic.woff
D quarry/web/static/fonts/open-sans-bold.woff
D quarry/web/static/fonts/open-sans-italic.woff
D quarry/web/static/fonts/open-sans-light-italic.woff
D quarry/web/static/fonts/open-sans-light.woff
D quarry/web/static/fonts/open-sans.woff
M quarry/web/templates/base.html
8 files changed, 1 insertion(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/quarry/web 
refs/changes/14/371514/1

diff --git a/quarry/web/static/css/fonts.css b/quarry/web/static/css/fonts.css
deleted file mode 100644
index 93351db..000
--- a/quarry/web/static/css/fonts.css
+++ /dev/null
@@ -1,37 +0,0 @@
-@font-face {
-  font-family: 'Open Sans';
-  font-style: normal;
-  font-weight: 300;
-  src: local('Open Sans Light'), local('OpenSans-Light'), 
url(/static/fonts/open-sans-light.woff) format('woff');
-}
-@font-face {
-  font-family: 'Open Sans';
-  font-style: normal;
-  font-weight: 400;
-  src: local('Open Sans'), local('OpenSans'), 
url(/static/fonts/open-sans.woff) format('woff');
-}
-@font-face {
-  font-family: 'Open Sans';
-  font-style: normal;
-  font-weight: 700;
-  src: local('Open Sans Bold'), local('OpenSans-Bold'), 
url(/static/fonts/open-sans-bold.woff) format('woff');
-}
-@font-face {
-  font-family: 'Open Sans';
-  font-style: italic;
-  font-weight: 300;
-  src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), 
url(/static/fonts/open-sans-light-italic.woff) format('woff');
-}
-@font-face {
-  font-family: 'Open Sans';
-  font-style: italic;
-  font-weight: 400;
-  src: local('Open Sans Italic'), local('OpenSans-Italic'), 
url(/static/fonts/open-sans-italic.woff) format('woff');
-}
-@font-face {
-  font-family: 'Open Sans';
-  font-style: italic;
-  font-weight: 700;
-  src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), 
url(/static/fonts/open-sans-bold-italic.woff) format('woff');
-}
-
diff --git a/quarry/web/static/fonts/open-sans-bold-italic.woff 
b/quarry/web/static/fonts/open-sans-bold-italic.woff
deleted file mode 100644
index a4e29c0..000
--- a/quarry/web/static/fonts/open-sans-bold-italic.woff
+++ /dev/null
Binary files differ
diff --git a/quarry/web/static/fonts/open-sans-bold.woff 
b/quarry/web/static/fonts/open-sans-bold.woff
deleted file mode 100644
index dacf3c9..000
--- a/quarry/web/static/fonts/open-sans-bold.woff
+++ /dev/null
Binary files differ
diff --git a/quarry/web/static/fonts/open-sans-italic.woff 
b/quarry/web/static/fonts/open-sans-italic.woff
deleted file mode 100644
index c5f6bac..000
--- a/quarry/web/static/fonts/open-sans-italic.woff
+++ /dev/null
Binary files differ
diff --git a/quarry/web/static/fonts/open-sans-light-italic.woff 
b/quarry/web/static/fonts/open-sans-light-italic.woff
deleted file mode 100644
index 3f9f088..000
--- a/quarry/web/static/fonts/open-sans-light-italic.woff
+++ /dev/null
Binary files differ
diff --git a/quarry/web/static/fonts/open-sans-light.woff 
b/quarry/web/static/fonts/open-sans-light.woff
deleted file mode 100644
index eb601d7..000
--- a/quarry/web/static/fonts/open-sans-light.woff
+++ /dev/null
Binary files differ
diff --git a/quarry/web/static/fonts/open-sans.woff 
b/quarry/web/static/fonts/open-sans.woff
deleted file mode 100644
index 77706fa..000
--- a/quarry/web/static/fonts/open-sans.woff
+++ /dev/null
Binary files differ
diff --git a/quarry/web/templates/base.html b/quarry/web/templates/base.html
index b60ad60..718c561 100644
--- a/quarry/web/templates/base.html
+++ b/quarry/web/templates/base.html
@@ -17,7 +17,7 @@
 
 {% endif %}
 
-
+
 
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28d78a1d5a4525b6a3e433d278a7c51c37338b08
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] RelPath[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.1

2017-07-29 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368544 )

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.1
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.1

Change-Id: I4bf91f68df9f3ff83d631607a1b1588406ac2d3d
---
M composer.json
M phpcs.xml
M src/RelPath.php
M tests/RelPathTest.php
4 files changed, 56 insertions(+), 53 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/RelPath refs/changes/44/368544/1

diff --git a/composer.json b/composer.json
index 5f1af2c..23b4a61 100644
--- a/composer.json
+++ b/composer.json
@@ -20,7 +20,7 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9.0.0",
"phpunit/phpunit": "^4.8.9.0",
-   "mediawiki/mediawiki-codesniffer": "^0.4.0.0"
+   "mediawiki/mediawiki-codesniffer": "0.10.1"
},
"scripts": {
"test": [
diff --git a/phpcs.xml b/phpcs.xml
index a55f518..4b13c5d 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,6 +1,8 @@
 
 
-   
+   
+   
+   
 
.

diff --git a/src/RelPath.php b/src/RelPath.php
index 62b5bbe..86103c0 100644
--- a/src/RelPath.php
+++ b/src/RelPath.php
@@ -34,7 +34,7 @@
  * @return array Array of path components.
  */
 function splitPath( $path ) {
-   $fragments = array();
+   $fragments = [];
 
while ( true ) {
$cur = dirname( $path );
@@ -105,13 +105,12 @@
 
$relList = ( $countStartParts > $i )
? array_fill( 0, $countStartParts - $i, '..' )
-   : array();
+   : [];
 
$relList = array_merge( $relList, array_slice( $pathParts, $i ) );
 
return implode( '/', $relList ) ?: '.';
 }
-
 
 /**
  * Join path components.
@@ -122,11 +121,13 @@
  */
 function joinPath( $base, $path ) {
if ( substr( $path, 0, 1 ) === '/' ) {
-   return $path;  // $path is absolute.
+   // $path is absolute.
+   return $path;
}
 
if ( substr( $base, 0, 1 ) !== '/' ) {
-   return false;  // $base is relative.
+   // $base is relative.
+   return false;
}
 
$pathParts = splitPath( $path );
diff --git a/tests/RelPathTest.php b/tests/RelPathTest.php
index 46c1602..7a418af 100644
--- a/tests/RelPathTest.php
+++ b/tests/RelPathTest.php
@@ -28,55 +28,55 @@
 class RelPathTest extends \PHPUnit_Framework_TestCase {
 
public function provideRelPathTestCases() {
-   return array(
-   array( '/foo/bar/', '/foo/bar/baz/', '..' ),
-   array( '/foo/bar/', '/foo/bar/baz.txt', '..' ),
-   array( '/foo/bar/', '/foo/bar/', '.' ),
-   array( '/foo/bar/', '/foo/bar/', '.' ),
-   array( '/', '/foo/', '..' ),
-   array( '/', '/foo/bar.txt', '../..' ),
-   array( '/', '/foo/bar/baz.txt', '../../..' ),
-   array( '/foo/bar/', '/foo/baz/', '../bar' ),
-   array( '/foo/bar/', '/foo/baz.txt', '../bar' ),
-   array( '/foo/bar/baz/', '/foo/bar/', 'baz' ),
-   array( '/foo/bar/baz', '/foo/bar', 'baz' ),
-   array( '/foo/bar.txt', '/foo/baz/', '../bar.txt' ),
-   array( '/foo/bar.txt', '/foo/baz.txt', '../bar.txt' ),
-   array( '/foo/bar', '/foo/baz/', '../bar' ),
-   array( '/foo/bar', '/foo/baz.txt', '../bar' ),
-   array( '/foo/bar', '/foo/bar/baz/', '..' ),
-   array( '/foo/bar', '/foo/bar/baz.txt', '..' ),
-   array( '/foo/bar/bat', '/x/y/z', '../../../foo/bar/bat' 
),
-   array( '/foo/bar/bat', '/foo/bar', 'bat' ),
-   array( '/foo/bar/bat', '/', 'foo/bar/bat' ),
-   array( '/', '/foo/bar/bat', '../../..' ),
-   array( '/foo/bar/bat', '/x', '../foo/bar/bat' ),
-   array( '/x', '/foo/bar/bat', '../../../x' ),
-   array( '/', '/', '.' ),
-   array( '/a', '/a', '.' ),
-   array( '/a/b', '/a/b', '.' ),
-   array( 'foo/bar', 'quux', false ),
-   array( '/foo\\bar/', '/foo\\bar/baz/', '..' ),
-   );
+   return [
+   [ '/foo/bar/', '/foo/bar/baz/', '..' ],
+   [ '/foo/bar/', '/foo/bar/baz.txt', '..' ],
+   [ '/foo/bar/', '/foo/bar/', '.' ],
+   [ '/foo/bar/', '/foo/bar/', '.' ],
+   [ '/', '/foo/', '..' ],
+   [ '/', '/foo/bar.txt', '../..' ],
+   [ '/', '/foo/bar/baz.txt', '../../..' ],
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix some PHPDoc type hints in DatabaseMysqli

2017-07-29 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368540 )

Change subject: Fix some PHPDoc type hints in DatabaseMysqli
..

Fix some PHPDoc type hints in DatabaseMysqli

Use `@param mysqli_result` instead of `@param mysqli`.

Change-Id: I7e759c740f51463c5eda884debc0e12655b2
---
M includes/libs/rdbms/database/DatabaseMysqli.php
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/40/368540/1

diff --git a/includes/libs/rdbms/database/DatabaseMysqli.php 
b/includes/libs/rdbms/database/DatabaseMysqli.php
index fcd29c3..4d1b87b 100644
--- a/includes/libs/rdbms/database/DatabaseMysqli.php
+++ b/includes/libs/rdbms/database/DatabaseMysqli.php
@@ -23,6 +23,7 @@
 namespace Wikimedia\Rdbms;
 
 use mysqli;
+use mysqli_result;
 use IP;
 
 /**
@@ -190,7 +191,7 @@
}
 
/**
-* @param mysqli $res
+* @param mysqli_result $res
 * @return bool
 */
protected function mysqlFreeResult( $res ) {
@@ -200,7 +201,7 @@
}
 
/**
-* @param mysqli $res
+* @param mysqli_result $res
 * @return bool
 */
protected function mysqlFetchObject( $res ) {
@@ -213,7 +214,7 @@
}
 
/**
-* @param mysqli $res
+* @param mysqli_result $res
 * @return bool
 */
protected function mysqlFetchArray( $res ) {
@@ -226,7 +227,7 @@
}
 
/**
-* @param mysqli $res
+* @param mysqli_result $res
 * @return mixed
 */
protected function mysqlNumRows( $res ) {
@@ -287,7 +288,7 @@
}
 
/**
-* @param mysqli $res
+* @param mysqli_result $res
 * @param int $row
 * @return mixed
 */

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

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

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: Fix some PHPDoc @return tags

2017-07-22 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367124 )

Change subject: Fix some PHPDoc @return tags
..

Fix some PHPDoc @return tags

The return type must not be enclosed in curly braces.

Change-Id: I481ee0bee2a8d457db3311a2c5ccbf31c6df3a7b
---
M php/Tag.php
M php/Widget.php
M php/mixins/TabIndexedElement.php
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/24/367124/1

diff --git a/php/Tag.php b/php/Tag.php
index 5579f3d..9273455 100644
--- a/php/Tag.php
+++ b/php/Tag.php
@@ -275,7 +275,7 @@
/**
 * Generate a unique ID for element
 *
-* @return {string} ID
+* @return string ID
 */
public static function generateElementId() {
self::$elementId++;
diff --git a/php/Widget.php b/php/Widget.php
index a93fbfb..13b937a 100644
--- a/php/Widget.php
+++ b/php/Widget.php
@@ -66,7 +66,7 @@
 * Get an ID of a labelable node which is part of this widget, if any, 
to be used for
 * `` value.
 *
-* @return {string|null} The ID of the labelable node
+* @return string|null The ID of the labelable node
 */
public function getInputId() {
return null;
diff --git a/php/mixins/TabIndexedElement.php b/php/mixins/TabIndexedElement.php
index 5132d5d..398281e 100644
--- a/php/mixins/TabIndexedElement.php
+++ b/php/mixins/TabIndexedElement.php
@@ -92,7 +92,7 @@
 * If the element already has an ID then that is returned, otherwise 
unique ID is
 * generated, set on the element, and returned.
 *
-* @return {string|null} The ID of the focusable element
+* @return string|null The ID of the focusable element
 */
public function getInputId() {
$id = $this->tabIndexed->getAttribute( 'id' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I481ee0bee2a8d457db3311a2c5ccbf31c6df3a7b
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Use SerializerFactory::OPTION_OBJECTS_FOR_MAPS by default

2017-07-07 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363853 )

Change subject: Use SerializerFactory::OPTION_OBJECTS_FOR_MAPS by default
..

Use SerializerFactory::OPTION_OBJECTS_FOR_MAPS by default

Because maps.

Change-Id: Ic2cf9198f13d287b580ca2bde7d0573c854c34fe
---
M repo/includes/WikibaseRepo.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index 03b3ff9..d245e01 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -1409,7 +1409,7 @@
 *
 * @return Serializer
 */
-   public function getAllTypesEntitySerializer( $options = 
SerializerFactory::OPTION_DEFAULT ) {
+   public function getAllTypesEntitySerializer( $options = 
SerializerFactory::OPTION_OBJECTS_FOR_MAPS ) {
if ( !isset( $this->entitySerializers[$options] ) ) {
$serializerFactoryCallbacks = 
$this->entityTypeDefinitions->getSerializerFactoryCallbacks();
$baseSerializerFactory = 
$this->getBaseDataModelSerializerFactory( $options );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2cf9198f13d287b580ca2bde7d0573c854c34fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...ptable[master]: Change group 1 item, add alkali-metal class

2017-04-18 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348696 )

Change subject: Change group 1 item, add alkali-metal class
..

Change group 1 item, add alkali-metal class

Q19557 now stands for alkali metals, whereas Q29366681 is used
for all group 1 elements (including hydrogen)

Change-Id: I0067e4e68e6ae1088dae0b5b3a6913e42082549d
---
M data.py
M static/table.css
2 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/96/348696/1

diff --git a/data.py b/data.py
index 41f7d16..5d1df49 100644
--- a/data.py
+++ b/data.py
@@ -32,7 +32,7 @@
 986218
 ]
 groups = [
-19557,
+29366681,
 19563,
 108307,
 189302,
@@ -59,6 +59,7 @@
 ]
 
 special_subclasses = {
+19557: 'alkali-metal',
 19591: 'post-transition-metal',
 19596: 'metalloid',
 19753344: 'diatomic-nonmetal',
diff --git a/static/table.css b/static/table.css
index 4c76a5e..518b100 100644
--- a/static/table.css
+++ b/static/table.css
@@ -53,7 +53,7 @@
 }
 
 /* alkali metals */
-table#period .element.group-1 {
+table#period .element.alkali-metal {
background: #f66;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0067e4e68e6ae1088dae0b5b3a6913e42082549d
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/ptable
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...LoginNotify[master]: Fix some typos

2017-03-09 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341985 )

Change subject: Fix some typos
..

Fix some typos

The names of two private methods have been changed.

Change-Id: I966930bdf44190c3b5262ddaf13b9ed46a478735
---
M LoginNotify.hooks.php
M LoginNotify_body.php
M i18n/qqq.json
3 files changed, 12 insertions(+), 12 deletions(-)


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

diff --git a/LoginNotify.hooks.php b/LoginNotify.hooks.php
index f560f0e..dff1ffb 100644
--- a/LoginNotify.hooks.php
+++ b/LoginNotify.hooks.php
@@ -98,7 +98,7 @@
/**
 * Hook for login auditing post 1.27
 *
-* @param $ret AuthenticationResponse Is login succesful?
+* @param $ret AuthenticationResponse Is login successful?
 * @param $user User|null User object on successful auth
 * @param $username String Username for failed attempts.
 */
@@ -171,7 +171,7 @@
 * Hook for loading options.
 *
 * This is a bit hacky. Used to be able to set a different
-* default for admins then other users
+* default for admins than other users
 *
 * @param $user User
 * @param &$options array
@@ -183,12 +183,12 @@
return true;
}
 
-   if ( !self::isUserOptionOverriden( $user ) ) {
+   if ( !self::isUserOptionOverridden( $user ) ) {
return true;
}
 
$defaultOpts = User::getDefaultOptions();
-   $optionsToCheck = self::getOverridenOptions();
+   $optionsToCheck = self::getOverriddenOptions();
 
foreach ( $optionsToCheck as $opt ) {
if ( $options[$opt] === self::OPTIONS_FAKE_FALSE ) {
@@ -208,7 +208,7 @@
 * Hook for saving options.
 *
 * This is a bit hacky. Used to be able to set a different
-* default for admins then other users. Since admins are higher value
+* default for admins than other users. Since admins are higher value
 * targets, it may make sense to have notices enabled by default for
 * them, but disabled for normal users.
 *
@@ -220,9 +220,9 @@
 * @return bool
 */
public static function onUserSaveOptions( User $user, array &$options ) 
{
-   $optionsToCheck = self::getOverridenOptions();
+   $optionsToCheck = self::getOverriddenOptions();
$defaultOpts = User::getDefaultOptions();
-   if ( !self::isUserOptionOverriden( $user ) ) {
+   if ( !self::isUserOptionOverridden( $user ) ) {
return true;
}
foreach ( $optionsToCheck as $opt ) {
@@ -252,7 +252,7 @@
 *
 * @return array Which option keys to check
 */
-   private static function getOverridenOptions() {
+   private static function getOverriddenOptions() {
// For login-success, it makes most sense to email
// people about it, but auto-subscribing people to email
// is a bit icky as nobody likes to be spammed.
@@ -262,7 +262,7 @@
];
}
 
-   private static function isUserOptionOverriden( User $user ) {
+   private static function isUserOptionOverridden( User $user ) {
global $wgLoginNotifyEnableForPriv;
// Note: isAllowedAny calls into session for per-session 
restrictions,
// which we do not want to take into account, and more 
importantly
diff --git a/LoginNotify_body.php b/LoginNotify_body.php
index 8abe5f2..21e46e0 100644
--- a/LoginNotify_body.php
+++ b/LoginNotify_body.php
@@ -245,7 +245,7 @@
 * Actually do the query of the check user table.
 *
 * @note This catches and ignores database errors.
-* @param $userId int User id number (Not neccesarily for the local 
wiki)
+* @param $userId int User id number (Not necessarily for the local 
wiki)
 * @param $ipFragment string Prefix to match against cuc_ip (from 
$this->getIPNetwork())
 * @param $dbr Database A database connection (possibly foreign)
 * @return boolean If $ipFragment is in check user db
@@ -607,7 +607,7 @@
/**
 * Clear attempt counter for user.
 *
-* When a user succesfully logs in, we start back from 0, as
+* When a user successfully logs in, we start back from 0, as
 * otherwise a mistake here and there will trigger the warning.
 *
 * @param $user User
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b6fe6f9..d606ee2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -17,5 +17,5 @@
"notification-header-login-success": "Text of notification for when 
someone 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix documentation comment for MessageParameterFormatter::for...

2017-02-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339106 )

Change subject: Fix documentation comment for 
MessageParameterFormatter::formatValueList()
..

Fix documentation comment for MessageParameterFormatter::formatValueList()

The returned value is a string.
Found by PHPStan.

Change-Id: I468e4cd4a2cf8c9c2b0f4c64b15d92747720e932
---
M repo/includes/Localizer/MessageParameterFormatter.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/repo/includes/Localizer/MessageParameterFormatter.php 
b/repo/includes/Localizer/MessageParameterFormatter.php
index 01a5c41..d1140a6 100644
--- a/repo/includes/Localizer/MessageParameterFormatter.php
+++ b/repo/includes/Localizer/MessageParameterFormatter.php
@@ -92,7 +92,7 @@
/**
 * @param array $values
 *
-* @return string[]
+* @return string
 */
private function formatValueList( array $values ) {
$formatted = array();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I468e4cd4a2cf8c9c2b0f4c64b15d92747720e932
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix documentation comment for EntityDataUriManager::getDocUrl()

2017-02-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339105 )

Change subject: Fix documentation comment for EntityDataUriManager::getDocUrl()
..

Fix documentation comment for EntityDataUriManager::getDocUrl()

According to Title::getFullURL() the returned value should be a string.
Found by PHPStan.

Change-Id: I05a0cd62966c1529939f8fa993fb23d9e4482856
---
M repo/includes/LinkedData/EntityDataUriManager.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/repo/includes/LinkedData/EntityDataUriManager.php 
b/repo/includes/LinkedData/EntityDataUriManager.php
index bc955d8..50e7cff 100644
--- a/repo/includes/LinkedData/EntityDataUriManager.php
+++ b/repo/includes/LinkedData/EntityDataUriManager.php
@@ -172,7 +172,7 @@
 * @param string|null $format   The (normalized) format name, or ''
 * @param int $revision
 *
-* @return Title
+* @return string
 */
public function getDocUrl( EntityId $id, $format = '', $revision = 0 ) {
$params = '';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05a0cd62966c1529939f8fa993fb23d9e4482856
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix documentation comment for ChangeOpAliases property $action

2017-02-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339104 )

Change subject: Fix documentation comment for ChangeOpAliases property $action
..

Fix documentation comment for ChangeOpAliases property $action

It is a string. The type is checked in the constructor.
Found by PHPStan.

Change-Id: I9810126732f5166c9de189383aa21eb29fffd5a8
---
M repo/includes/ChangeOp/ChangeOpAliases.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/repo/includes/ChangeOp/ChangeOpAliases.php 
b/repo/includes/ChangeOp/ChangeOpAliases.php
index a6ca8a3..6ab889d 100644
--- a/repo/includes/ChangeOp/ChangeOpAliases.php
+++ b/repo/includes/ChangeOp/ChangeOpAliases.php
@@ -30,7 +30,7 @@
private $aliases;
 
/**
-* @var array
+* @var string
 */
private $action;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9810126732f5166c9de189383aa21eb29fffd5a8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix documentation comment for SpecialRedirectEntity::getForm...

2017-02-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339100 )

Change subject: Fix documentation comment for 
SpecialRedirectEntity::getFormElements()
..

Fix documentation comment for SpecialRedirectEntity::getFormElements()

The returned value is always an array.
Found by PHPStan.
Leftover from commit 4c93d7ba13f14f95bd724fd6581f7cdc938bded5

Change-Id: I73eecbaa7f910c951186701fd26a1debbe9fb585
---
M repo/includes/Specials/SpecialRedirectEntity.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/repo/includes/Specials/SpecialRedirectEntity.php 
b/repo/includes/Specials/SpecialRedirectEntity.php
index 55c0998..9343fb4 100644
--- a/repo/includes/Specials/SpecialRedirectEntity.php
+++ b/repo/includes/Specials/SpecialRedirectEntity.php
@@ -185,7 +185,7 @@
/**
 * Returns the form elements.
 *
-* @return string
+* @return array
 */
protected function getFormElements() {
return array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73eecbaa7f910c951186701fd26a1debbe9fb585
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Declare SummaryFormatter property $stringNormalizer as private

2017-02-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339098 )

Change subject: Declare SummaryFormatter property $stringNormalizer as private
..

Declare SummaryFormatter property $stringNormalizer as private

It is currently set in the constructor without being declared.
Found by PHPStan.

Change-Id: I5fd5d3ae2a09e5268db7932ff00d39c1fed10b18
---
M repo/includes/SummaryFormatter.php
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/repo/includes/SummaryFormatter.php 
b/repo/includes/SummaryFormatter.php
index a875ecd..92dbcb0 100644
--- a/repo/includes/SummaryFormatter.php
+++ b/repo/includes/SummaryFormatter.php
@@ -48,6 +48,11 @@
private $idParser;
 
/**
+* @var StringNormalizer
+*/
+   private $stringNormalizer;
+
+   /**
 * @param EntityIdFormatter $idFormatter Please note that the magic 
label substitution we apply
 * on top of this only works in case this returns links without 
display text.
 * @param ValueFormatter $valueFormatter

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fd5d3ae2a09e5268db7932ff00d39c1fed10b18
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix some method calls with incorrect case

2017-02-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338968 )

Change subject: Fix some method calls with incorrect case
..

Fix some method calls with incorrect case

Found by PHPStan.

Change-Id: I00d1bca677d002b94ba7511a6b4a4db4ec2c0f02
---
M client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php
M client/tests/phpunit/includes/Hooks/MovePageNoticeTest.php
M client/tests/phpunit/includes/RecentChanges/ChangeLineFormatterTest.php
M client/tests/phpunit/includes/RecentChanges/RecentChangeFactoryTest.php
M repo/Wikibase.hooks.php
M repo/includes/Api/ParseValue.php
M repo/includes/Diff/EntityContentDiffView.php
M repo/includes/Specials/SpecialMyLanguageFallbackChain.php
M repo/includes/Specials/SpecialSetSiteLink.php
M repo/tests/phpunit/includes/Diff/ClaimDifferenceVisualizerTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
M repo/tests/phpunit/includes/Rdf/Values/GlobeCoordinateRdfBuilderTest.php
M repo/tests/phpunit/includes/Rdf/Values/TimeRdfBuilderTest.php
M repo/tests/phpunit/includes/Specials/SpecialEntityDataTest.php
M repo/tests/phpunit/includes/Specials/SpecialGoToLinkedPageTest.php
M repo/tests/phpunit/includes/Validators/ValidatorErrorLocalizerTest.php
16 files changed, 21 insertions(+), 21 deletions(-)


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

diff --git a/client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php 
b/client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php
index 9e2a2f9..16444b39 100644
--- a/client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php
+++ b/client/tests/phpunit/includes/Hooks/DataUpdateHookHandlersTest.php
@@ -203,7 +203,7 @@
->will( $this->returnValue( $ns ) );
 
$title->expects( $this->any() )
-   ->method( 'getDBKey' )
+   ->method( 'getDBkey' )
->will( $this->returnValue( $text ) );
 
return $title;
diff --git a/client/tests/phpunit/includes/Hooks/MovePageNoticeTest.php 
b/client/tests/phpunit/includes/Hooks/MovePageNoticeTest.php
index e0bb839..23806bf 100644
--- a/client/tests/phpunit/includes/Hooks/MovePageNoticeTest.php
+++ b/client/tests/phpunit/includes/Hooks/MovePageNoticeTest.php
@@ -63,7 +63,7 @@
->getMock();
 
$outputPage->expects( $this->once() )
-   ->method( 'addHtml' )
+   ->method( 'addHTML' )
->with( $expected );
 
$outputPage->expects( $this->once() )
diff --git 
a/client/tests/phpunit/includes/RecentChanges/ChangeLineFormatterTest.php 
b/client/tests/phpunit/includes/RecentChanges/ChangeLineFormatterTest.php
index 6dbf523..94e848f 100644
--- a/client/tests/phpunit/includes/RecentChanges/ChangeLineFormatterTest.php
+++ b/client/tests/phpunit/includes/RecentChanges/ChangeLineFormatterTest.php
@@ -344,7 +344,7 @@
->will( $this->returnValue( $text ) );
 
$title->expects( $this->any() )
-   ->method( 'getDBKey' )
+   ->method( 'getDBkey' )
->will( $this->returnValue( str_replace( ' ', '_', 
$text ) ) );
 
$title->expects( $this->any() )
diff --git 
a/client/tests/phpunit/includes/RecentChanges/RecentChangeFactoryTest.php 
b/client/tests/phpunit/includes/RecentChanges/RecentChangeFactoryTest.php
index d94db33..bb96c2f 100644
--- a/client/tests/phpunit/includes/RecentChanges/RecentChangeFactoryTest.php
+++ b/client/tests/phpunit/includes/RecentChanges/RecentChangeFactoryTest.php
@@ -84,7 +84,7 @@
->will( $this->returnValue( $ns ) );
 
$title->expects( $this->any() )
-   ->method( 'getDBKey' )
+   ->method( 'getDBkey' )
->will( $this->returnValue( str_replace( ' ', '_', 
$text ) ) );
 
// XXX: This assumes NS_MAIN. Getting namespace names right 
nicely is hard, they depend on the lang.
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index a44fc9f..7b19ee8 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -384,7 +384,7 @@
$rev = new Revision( $row );
 
if ( $entityContentFactory->isEntityContentModel( 
$history->getTitle()->getContentModel() )
-   && $wikiPage->getLatest() !== $rev->getID()
+   && $wikiPage->getLatest() !== $rev->getId()
&& $rev->getTitle()->quickUserCan( 'edit', 
$history->getUser() )
&& !$rev->isDeleted( Revision::DELETED_TEXT )
) {
@@ -980,7 +980,7 @@
$baseUri = 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Enforce LinkBeginHookHandler::onLinkBegin() $query param as ...

2017-02-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338949 )

Change subject: Enforce LinkBeginHookHandler::onLinkBegin() $query param as 
array
..

Enforce LinkBeginHookHandler::onLinkBegin() $query param as array

According to the official MediaWiki hooks documentation, it should
be "in associative array form".

Not tested with any extensions that may modify the value.

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


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

diff --git a/repo/includes/Hooks/LinkBeginHookHandler.php 
b/repo/includes/Hooks/LinkBeginHookHandler.php
index e0934fa..c1ad179 100644
--- a/repo/includes/Hooks/LinkBeginHookHandler.php
+++ b/repo/includes/Hooks/LinkBeginHookHandler.php
@@ -91,12 +91,12 @@
 * @param Title $target
 * @param string $html
 * @param array $customAttribs
-* @param string $query
+* @param array $query
 * @param array $options
 * @param mixed $ret
 * @return bool true
 */
-   public static function onLinkBegin( $skin, $target, &$html, array 
&$customAttribs, &$query,
+   public static function onLinkBegin( $skin, $target, &$html, array 
&$customAttribs, array &$query,
&$options, &$ret
) {
$context = RequestContext::getMain();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60a040b7f411da270d86800195157c45914bdea1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix documentation comments for some WebRequest methods

2017-02-20 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338833 )

Change subject: Fix documentation comments for some WebRequest methods
..

Fix documentation comments for some WebRequest methods

WebRequest methods getRawVal(), getVal() and getArray()
can return null.

Change-Id: I555dfd93c7cdebc83aab89f3efe4de3018bc9de0
---
M includes/WebRequest.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/33/338833/1

diff --git a/includes/WebRequest.php b/includes/WebRequest.php
index 3bbdc3f..78d7444 100644
--- a/includes/WebRequest.php
+++ b/includes/WebRequest.php
@@ -408,7 +408,7 @@
 * @since 1.28
 * @param string $name
 * @param string|null $default Optional default
-* @return string
+* @return string|null
 */
public function getRawVal( $name, $default = null ) {
$name = strtr( $name, '.', '_' ); // See comment in 
self::getGPCVal()
@@ -432,7 +432,7 @@
 *
 * @param string $name
 * @param string $default Optional default (or null)
-* @return string
+* @return string|null
 */
public function getVal( $name, $default = null ) {
$val = $this->getGPCVal( $this->data, $name, $default );
@@ -482,7 +482,7 @@
 *
 * @param string $name
 * @param array $default Optional default (or null)
-* @return array
+* @return array|null
 */
public function getArray( $name, $default = null ) {
$val = $this->getGPCVal( $this->data, $name, $default );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix documentation for SpecialModifyTerm::getPostedValue()

2017-02-20 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338829 )

Change subject: Fix documentation for SpecialModifyTerm::getPostedValue()
..

Fix documentation for SpecialModifyTerm::getPostedValue()

The method can return null. This behavior happens in
practice and is expected by the caller.

Change-Id: I55189f80f7ca5a5e43f07f0e2c0ac8540dc203cf
---
M repo/includes/Specials/SpecialModifyTerm.php
M repo/includes/Specials/SpecialSetAliases.php
M repo/includes/Specials/SpecialSetDescription.php
M repo/includes/Specials/SpecialSetLabel.php
4 files changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/repo/includes/Specials/SpecialModifyTerm.php 
b/repo/includes/Specials/SpecialModifyTerm.php
index b9c7f2b..1b16ae7 100644
--- a/repo/includes/Specials/SpecialModifyTerm.php
+++ b/repo/includes/Specials/SpecialModifyTerm.php
@@ -264,7 +264,7 @@
/**
 * Returning the posted value of the request.
 *
-* @return string
+* @return string|null
 */
abstract protected function getPostedValue();
 
diff --git a/repo/includes/Specials/SpecialSetAliases.php 
b/repo/includes/Specials/SpecialSetAliases.php
index 1ed823c..100867c 100644
--- a/repo/includes/Specials/SpecialSetAliases.php
+++ b/repo/includes/Specials/SpecialSetAliases.php
@@ -39,7 +39,7 @@
/**
 * @see SpecialModifyTerm::getPostedValue()
 *
-* @return string
+* @return string|null
 */
protected function getPostedValue() {
return $this->getRequest()->getVal( 'aliases' );
diff --git a/repo/includes/Specials/SpecialSetDescription.php 
b/repo/includes/Specials/SpecialSetDescription.php
index 6de7b33..b9f2a95 100644
--- a/repo/includes/Specials/SpecialSetDescription.php
+++ b/repo/includes/Specials/SpecialSetDescription.php
@@ -39,7 +39,7 @@
/**
 * @see SpecialModifyTerm::getPostedValue()
 *
-* @return string
+* @return string|null
 */
protected function getPostedValue() {
return $this->getRequest()->getVal( 'description' );
diff --git a/repo/includes/Specials/SpecialSetLabel.php 
b/repo/includes/Specials/SpecialSetLabel.php
index 72e4dcf..0bb1476 100644
--- a/repo/includes/Specials/SpecialSetLabel.php
+++ b/repo/includes/Specials/SpecialSetLabel.php
@@ -39,7 +39,7 @@
/**
 * @see SpecialModifyTerm::getPostedValue()
 *
-* @return string
+* @return string|null
 */
protected function getPostedValue() {
return $this->getRequest()->getVal( 'label' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55189f80f7ca5a5e43f07f0e2c0ac8540dc203cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Subpage parameters in special pages can be null

2017-02-20 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338780 )

Change subject: Subpage parameters in special pages can be null
..

Subpage parameters in special pages can be null

Checked by observing types at runtime.

Change-Id: I3975b1044d66ae8878f345ad8cd3df8686b43f55
---
M repo/includes/Specials/SpecialEntitiesWithoutPage.php
M repo/includes/Specials/SpecialGoToLinkedPage.php
M repo/includes/Specials/SpecialListProperties.php
M repo/includes/Specials/SpecialModifyEntity.php
M repo/includes/Specials/SpecialModifyTerm.php
M repo/includes/Specials/SpecialSetLabelDescriptionAliases.php
M repo/includes/Specials/SpecialSetSiteLink.php
7 files changed, 12 insertions(+), 7 deletions(-)


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

diff --git a/repo/includes/Specials/SpecialEntitiesWithoutPage.php 
b/repo/includes/Specials/SpecialEntitiesWithoutPage.php
index 728008c..70c0ab6 100644
--- a/repo/includes/Specials/SpecialEntitiesWithoutPage.php
+++ b/repo/includes/Specials/SpecialEntitiesWithoutPage.php
@@ -108,7 +108,7 @@
/**
 * Prepare the arguments
 *
-* @param string $subPage
+* @param string|null $subPage
 */
private function prepareArguments( $subPage ) {
$request = $this->getRequest();
diff --git a/repo/includes/Specials/SpecialGoToLinkedPage.php 
b/repo/includes/Specials/SpecialGoToLinkedPage.php
index 16c8b0b..a2ba802 100644
--- a/repo/includes/Specials/SpecialGoToLinkedPage.php
+++ b/repo/includes/Specials/SpecialGoToLinkedPage.php
@@ -77,7 +77,7 @@
}
 
/**
-* @param string $subPage
+* @param string|null $subPage
 *
 * @return array array( string $site, string $itemString )
 */
diff --git a/repo/includes/Specials/SpecialListProperties.php 
b/repo/includes/Specials/SpecialListProperties.php
index 76cb26f..d2e928f 100644
--- a/repo/includes/Specials/SpecialListProperties.php
+++ b/repo/includes/Specials/SpecialListProperties.php
@@ -110,6 +110,11 @@
}
}
 
+   /**
+* Prepares the arguments.
+*
+* @param string|null $subPage
+*/
private function prepareArguments( $subPage ) {
$request = $this->getRequest();
 
diff --git a/repo/includes/Specials/SpecialModifyEntity.php 
b/repo/includes/Specials/SpecialModifyEntity.php
index f703f75..afb516a 100644
--- a/repo/includes/Specials/SpecialModifyEntity.php
+++ b/repo/includes/Specials/SpecialModifyEntity.php
@@ -150,7 +150,7 @@
/**
 * Prepares the arguments.
 *
-* @param string $subPage
+* @param string|null $subPage
 */
protected function prepareArguments( $subPage ) {
$parts = $subPage === '' ? array() : explode( '/', $subPage, 2 
);
diff --git a/repo/includes/Specials/SpecialModifyTerm.php 
b/repo/includes/Specials/SpecialModifyTerm.php
index cbfc106..b9c7f2b 100644
--- a/repo/includes/Specials/SpecialModifyTerm.php
+++ b/repo/includes/Specials/SpecialModifyTerm.php
@@ -66,7 +66,7 @@
/**
 * @see SpecialModifyEntity::prepareArguments()
 *
-* @param string $subPage
+* @param string|null $subPage
 */
protected function prepareArguments( $subPage ) {
parent::prepareArguments( $subPage );
diff --git a/repo/includes/Specials/SpecialSetLabelDescriptionAliases.php 
b/repo/includes/Specials/SpecialSetLabelDescriptionAliases.php
index c5ab378..c2e66b6 100644
--- a/repo/includes/Specials/SpecialSetLabelDescriptionAliases.php
+++ b/repo/includes/Specials/SpecialSetLabelDescriptionAliases.php
@@ -246,7 +246,7 @@
/**
 * @see SpecialModifyEntity::prepareArguments
 *
-* @param string $subPage
+* @param string|null $subPage
 */
protected function prepareArguments( $subPage ) {
$this->extractInput( $subPage );
@@ -274,7 +274,7 @@
}
 
/**
-* @param string $subPage
+* @param string|null $subPage
 */
private function extractInput( $subPage ) {
$request = $this->getRequest();
diff --git a/repo/includes/Specials/SpecialSetSiteLink.php 
b/repo/includes/Specials/SpecialSetSiteLink.php
index 20d5977..27b5f0d 100644
--- a/repo/includes/Specials/SpecialSetSiteLink.php
+++ b/repo/includes/Specials/SpecialSetSiteLink.php
@@ -108,7 +108,7 @@
/**
 * @see SpecialModifyEntity::prepareArguments()
 *
-* @param string $subPage
+* @param string|null $subPage
 */
protected function prepareArguments( $subPage ) {
parent::prepareArguments( $subPage );

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

Gerrit-MessageType: 

[MediaWiki-commits] [Gerrit] labs...ptable[master]: Merge half-life query into general nuclides query

2017-02-11 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337251 )

Change subject: Merge half-life query into general nuclides query
..

Merge half-life query into general nuclides query

Decrease number of WDQS API requests.

Change-Id: Ib2ae8de4a717daa83f1363b9f8f9d7be75a451fc
---
M nuclides.py
1 file changed, 16 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/51/337251/1

diff --git a/nuclides.py b/nuclides.py
index ff0f4b0..08225f2 100644
--- a/nuclides.py
+++ b/nuclides.py
@@ -117,17 +117,23 @@
 """Load nuclide info from Wikidata Sparql endpoint."""
 def __iter__(self):
 nuclides = defaultdict(Nuclide)
-nuclides_query = "SELECT ?nuclide ?atomic_number ?neutron_number 
?stable ?label WHERE {{ \
+nuclides_query = "SELECT ?nuclide ?atomic_number ?neutron_number 
?half_life ?half_life_unit ?stable ?label WHERE {{ \
 ?nuclide wdt:P{0}/wdt:P{1}* wd:Q{2} ; \
  wdt:P{3} ?atomic_number ; \
  wdt:P{4} ?neutron_number ; \
  rdfs:label ?label ; \
+OPTIONAL {{ \
+?nuclide p:P{7} ?hl_statement . \
+?hl_statement psv:P{7} ?hl_value . \
+?hl_value wikibase:quantityAmount ?half_life ; \
+  wikibase:quantityUnit ?half_life_unit . \
+}} \
 FILTER NOT EXISTS {{ ?nuclide wdt:P{0} wd:Q{5} . }} \
 FILTER(lang(?label) = 'en') \
 BIND( EXISTS {{ ?nuclide wdt:P{0} wd:Q{6} . }} AS ?stable ) \
 }}".format(Nuclide.instance_pid, Nuclide.subclass_pid, Nuclide.isotope_qid,
 Nuclide.atomic_number_pid, Nuclide.neutron_number_pid,
-Nuclide.isomer_qid, Nuclide.stable_qid)
+Nuclide.isomer_qid, Nuclide.stable_qid, Nuclide.half_life_pid)
 query_result = self.get_sparql(nuclides_query)
 for nuclide_result in query_result:
 nuclide_uri = nuclide_result['nuclide']['value']
@@ -137,30 +143,19 @@
 nuclides[nuclide_uri].atomic_number = int(atomic_number)
 nuclides[nuclide_uri].neutron_number = int(neutron_number)
 nuclides[nuclide_uri].label = label
-nuclides[nuclide_uri].half_life = None
+if not hasattr(nuclides[nuclide_uri], 'half_life'):
+nuclides[nuclide_uri].half_life = None
 nuclides[nuclide_uri].item_id = nuclide_uri.split('/')[-1]
 if nuclide_result['stable']['value'] == 'true':
 nuclides[nuclide_uri].classes.append('stable')
-
-hl_query = "SELECT ?nuclide ?half_life ?half_life_unit WHERE {{ \
-?nuclide wdt:P{0}/wdt:P{1}* wd:Q{2} ; \
- p:P{3} ?hl_statement . \
-?hl_statement psv:P{3} ?hl_value . \
-?hl_value wikibase:quantityAmount ?half_life ; \
-  wikibase:quantityUnit ?half_life_unit . \
-}}".format(Nuclide.instance_pid, Nuclide.subclass_pid, Nuclide.isotope_qid,
-Nuclide.half_life_pid)
-
-query_result = self.get_sparql(hl_query)
-for nuclide_result in query_result:
-nuclide_uri = nuclide_result['nuclide']['value']
+if 'half_life' not in nuclide_result:
+continue
 if nuclide_result['half_life']['value'] == '0':
 continue  # WDQS bug: values sometimes zero - skip
-if nuclide_uri in nuclides:
-if nuclides[nuclide_uri].half_life is None:
-nuclides[nuclide_uri].half_life = time_in_seconds(
-nuclide_result['half_life']['value'],
-nuclide_result['half_life_unit']['value'])
+if nuclides[nuclide_uri].half_life is None:
+nuclides[nuclide_uri].half_life = time_in_seconds(
+nuclide_result['half_life']['value'],
+nuclide_result['half_life_unit']['value'])
 # else - sparql returned more than 1 half-life value - problem?
 
 decay_query = "SELECT ?nuclide ?decay_to ?decay_mode ?fraction WHERE 
{{ \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2ae8de4a717daa83f1363b9f8f9d7be75a451fc
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/ptable
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...ptable[master]: Merge stable nuclides query into general nuclides query

2017-02-11 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337219 )

Change subject: Merge stable nuclides query into general nuclides query
..

Merge stable nuclides query into general nuclides query

Decrease number of WDQS API requests.

Change-Id: Ia02c7e96c1dee82517dec77d76a64db7f1054a22
---
M nuclides.py
1 file changed, 5 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/19/337219/1

diff --git a/nuclides.py b/nuclides.py
index 6660201..ff0f4b0 100644
--- a/nuclides.py
+++ b/nuclides.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 """
 Copyright © 2015, 2016 ArthurPSmith
-Copyright © 2016 Ricordisamoa
+Copyright © 2016-2017 Ricordisamoa
 
 This file is part of the Wikidata periodic table.
 
@@ -117,16 +117,17 @@
 """Load nuclide info from Wikidata Sparql endpoint."""
 def __iter__(self):
 nuclides = defaultdict(Nuclide)
-nuclides_query = "SELECT ?nuclide ?atomic_number ?neutron_number 
?label WHERE {{ \
+nuclides_query = "SELECT ?nuclide ?atomic_number ?neutron_number 
?stable ?label WHERE {{ \
 ?nuclide wdt:P{0}/wdt:P{1}* wd:Q{2} ; \
  wdt:P{3} ?atomic_number ; \
  wdt:P{4} ?neutron_number ; \
  rdfs:label ?label ; \
 FILTER NOT EXISTS {{ ?nuclide wdt:P{0} wd:Q{5} . }} \
 FILTER(lang(?label) = 'en') \
+BIND( EXISTS {{ ?nuclide wdt:P{0} wd:Q{6} . }} AS ?stable ) \
 }}".format(Nuclide.instance_pid, Nuclide.subclass_pid, Nuclide.isotope_qid,
 Nuclide.atomic_number_pid, Nuclide.neutron_number_pid,
-Nuclide.isomer_qid)
+Nuclide.isomer_qid, Nuclide.stable_qid)
 query_result = self.get_sparql(nuclides_query)
 for nuclide_result in query_result:
 nuclide_uri = nuclide_result['nuclide']['value']
@@ -138,16 +139,7 @@
 nuclides[nuclide_uri].label = label
 nuclides[nuclide_uri].half_life = None
 nuclides[nuclide_uri].item_id = nuclide_uri.split('/')[-1]
-
-stable_query = "SELECT ?nuclide WHERE {{ \
-?nuclide wdt:P{0}/wdt:P{1}* wd:Q{2} ; \
- wdt:P{0} wd:Q{3} . \
-}}".format(Nuclide.instance_pid, Nuclide.subclass_pid, Nuclide.isotope_qid,
-Nuclide.stable_qid)
-query_result = self.get_sparql(stable_query)
-for nuclide_result in query_result:
-nuclide_uri = nuclide_result['nuclide']['value']
-if nuclide_uri in nuclides:
+if nuclide_result['stable']['value'] == 'true':
 nuclides[nuclide_uri].classes.append('stable')
 
 hl_query = "SELECT ?nuclide ?half_life ?half_life_unit WHERE {{ \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia02c7e96c1dee82517dec77d76a64db7f1054a22
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/ptable
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] analytics...web[master]: Drop redundant Bootstrap CSS

2017-02-10 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337214 )

Change subject: Drop redundant Bootstrap CSS
..

Drop redundant Bootstrap CSS

Users of Bootswatch CSS should "replace Bootstrap's default stylesheet"
as stated in https://github.com/thomaspark/bootswatch#usage

Change-Id: I36d28993c42004379f0da5822521c7a820f30184
---
M quarry/web/templates/base.html
1 file changed, 1 insertion(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/quarry/web 
refs/changes/14/337214/1

diff --git a/quarry/web/templates/base.html b/quarry/web/templates/base.html
index 01c7df5..b60ad60 100644
--- a/quarry/web/templates/base.html
+++ b/quarry/web/templates/base.html
@@ -16,10 +16,7 @@
 var vars = {{jsvars|tojson}};
 
 {% endif %}
-
-
-
-
+
 
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36d28993c42004379f0da5822521c7a820f30184
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ApiPurge: update description for POST requirement

2017-02-03 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335968 )

Change subject: ApiPurge: update description for POST requirement
..

ApiPurge: update description for POST requirement

Follow-up to eada94090990f9d06a3b512efc1ca7e6eb4bb2f1.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/335968/1

diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index d92d78b..c32b5e8 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -389,7 +389,7 @@
"apihelp-protect-example-unprotect": "Unprotect a page by setting 
restrictions to all (i.e. everyone is allowed to take the action).",
"apihelp-protect-example-unprotect2": "Unprotect a page by setting no 
restrictions.",
 
-   "apihelp-purge-description": "Purge the cache for the given 
titles.\n\nRequires a POST request if the user is not logged in.",
+   "apihelp-purge-description": "Purge the cache for the given titles.",
"apihelp-purge-param-forcelinkupdate": "Update the links tables.",
"apihelp-purge-param-forcerecursivelinkupdate": "Update the links 
table, and update the links tables for any page that uses this page as a 
template.",
"apihelp-purge-example-simple": "Purge the Main Page and the 
API page.",

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

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

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: doc: Add quotes around PROJECT_NAME setting

2017-02-03 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335961 )

Change subject: doc: Add quotes around PROJECT_NAME setting
..

doc: Add quotes around PROJECT_NAME setting

Otherwise spaces are stripped from the name, previously
rendered as "OOjsUI".

Change-Id: If413c81ec32097fa4483d8939875548263a68f99
---
M Doxyfile
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/61/335961/1

diff --git a/Doxyfile b/Doxyfile
index 7969e99..938aa52 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -1,6 +1,6 @@
 # Configuration file for Doxygen
 
-PROJECT_NAME   = OOjs UI
+PROJECT_NAME   = "OOjs UI"
 PROJECT_BRIEF  = "Object-Oriented JavaScript – User Interface"
 
 OUTPUT_DIRECTORY   = doc

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If413c81ec32097fa4483d8939875548263a68f99
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...SiteMatrix[master]: Standardize Doxygen @param tags

2017-02-03 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335834 )

Change subject: Standardize Doxygen @param tags
..

Standardize Doxygen @param tags

Use "@param datatype $paramname" format.

Change-Id: I41c410c3f77bf11bfae4a777ea1fbb7ec94f9db2
---
M SiteMatrix_body.php
1 file changed, 8 insertions(+), 8 deletions(-)


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

diff --git a/SiteMatrix_body.php b/SiteMatrix_body.php
index 05b03ab..7588004 100644
--- a/SiteMatrix_body.php
+++ b/SiteMatrix_body.php
@@ -107,8 +107,8 @@
}
 
/**
-* @param $a1 array
-* @param $a2 array
+* @param array $a1
+* @param array $a2
 * @return int
 */
public static function sortSpecial( $a1, $a2 ) {
@@ -151,7 +151,7 @@
}
 
/**
-* @param $site string
+* @param string $site
 * @return int
 */
public function getCountPerSite( $site ) {
@@ -159,7 +159,7 @@
}
 
/**
-* @param $site string
+* @param string $site
 * @return string
 */
public function getSiteUrl( $site ) {
@@ -190,8 +190,8 @@
}
 
/**
-* @param $minor string
-* @param $major string
+* @param string $minor
+* @param string $major
 * @return string
 */
public function getSitename( $minor, $major ) {
@@ -222,8 +222,8 @@
}
 
/**
-* @param $minor string
-* @param $major string
+* @param string $minor
+* @param string $major
 * @return string
 */
public function getDBName( $minor, $major ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41c410c3f77bf11bfae4a777ea1fbb7ec94f9db2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SiteMatrix
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] RelPath[master]: travis-ci: bypass Composer ssl on PHP 5.3.3

2017-01-24 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333861 )

Change subject: travis-ci: bypass Composer ssl on PHP 5.3.3
..

travis-ci: bypass Composer ssl on PHP 5.3.3

The PHP 5.3.3 builds provided by Travis-CI do not include SSL support.
This in turn causes modern versions of Composer to fail with default
configuration. When testing under PHP 5.3.3, configure Composer to use
non-tls connections.

Copied from the cdb repository.

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


  git pull ssh://gerrit.wikimedia.org:29418/RelPath refs/changes/61/333861/1

diff --git a/.travis.yml b/.travis.yml
index 4ee0465..ae8113f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,6 +9,8 @@
   - "7.0"
   - "7.1"
   - "hhvm"
+before_install:
+  - if [ "$TRAVIS_PHP_VERSION" = "5.3.3" ]; then composer config disable-tls 
true; composer config secure-http false; fi
 install:
   - composer install
 script:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia647863a168aa9e7eed6a99906386d134cc80a1f
Gerrit-PatchSet: 1
Gerrit-Project: RelPath
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] CLDRPluralRuleParser[master]: Doxyfile: wrap PROJECT_NAME and PROJECT_BRIEF in quotes

2017-01-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333466 )

Change subject: Doxyfile: wrap PROJECT_NAME and PROJECT_BRIEF in quotes
..

Doxyfile: wrap PROJECT_NAME and PROJECT_BRIEF in quotes

Otherwise they are read as single words without spaces.

Change-Id: Ide5b46c0143c8ffb5ecf3428a9be5da78ff89951
---
M Doxyfile
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/CLDRPluralRuleParser 
refs/changes/66/333466/1

diff --git a/Doxyfile b/Doxyfile
index c0f5685..e63b24c 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -1,7 +1,7 @@
 # Configuration file for Doxygen
 
-PROJECT_NAME   = CLDR Plural Rule Parser
-PROJECT_BRIEF  = Parses CLDR plural rules
+PROJECT_NAME   = "CLDR Plural Rule Parser"
+PROJECT_BRIEF  = "Parses CLDR plural rules"
 OUTPUT_DIRECTORY   = doc
 JAVADOC_AUTOBRIEF  = YES
 QT_AUTOBRIEF   = YES

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide5b46c0143c8ffb5ecf3428a9be5da78ff89951
Gerrit-PatchSet: 1
Gerrit-Project: CLDRPluralRuleParser
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...ptable[master]: [WIP] README.rst and Sphinx documentation

2017-01-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/67 )

Change subject: [WIP] README.rst and Sphinx documentation
..

[WIP] README.rst and Sphinx documentation

Bug: T99847
Change-Id: I6438ae3594e6e60e6838cdd5b272438fd112abae
---
A README.rst
A docs/conf.py
A docs/index.rst
A docs/requirements.txt
4 files changed, 180 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/67/67/1

diff --git a/README.rst b/README.rst
new file mode 100644
index 000..524881a
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,32 @@
+Wikidata periodic table
+===
+
+Python 3.3 or later is required to run this program. Using `virtual 
environments`_
+(or `virtualenv`_) is strongly recommended.
+
+Installing dependencies for running the program:
+
+.. code:: sh
+
+ pip install -r requirements.txt
+
+Installing dependencies for building the documentation:
+
+.. code:: sh
+
+ pip install -r docs/requirements.txt
+
+Generating API documentation from docstrings:
+
+.. code:: sh
+
+ sphinx-apidoc -f -o docs .
+
+Building the documentation:
+
+.. code:: sh
+
+ sphinx-build -a docs docs/_build
+
+.. _virtual environments: https://docs.python.org/3/library/venv.html
+.. _virtualenv: https://virtualenv.pypa.io
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 000..0510853
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,129 @@
+# -*- coding: utf-8 -*-
+"""
+Copyright © 2017 Ricordisamoa
+
+This file is part of the Wikidata periodic table.
+
+The Wikidata periodic table is free software: you can redistribute it and/or 
modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+The Wikidata periodic table is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the Wikidata periodic table.  If not, see 
.
+"""
+#
+# Wikidata periodic table documentation build configuration file, created by
+# sphinx-quickstart.
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+import os
+import sys
+
+
+sys.path.insert(0, os.path.abspath('..'))
+
+
+# -- General configuration 
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = ['sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = 'Wikidata periodic table'
+copyright = '2012-2017, Wikidata periodic table contributors'
+author = 'Wikidata periodic table contributors'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = ''
+# The full version, including alpha/beta/rc tags.
+release = ''
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- Options for HTML output --
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+#
+html_theme = 'alabaster'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see 

[MediaWiki-commits] [Gerrit] oojs/ui[master]: CapsuleMultiSelectWidget: call correct parent constructor

2017-01-17 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332739 )

Change subject: CapsuleMultiSelectWidget: call correct parent constructor
..

CapsuleMultiSelectWidget: call correct parent constructor

Change-Id: I47efa674905412d0205e0a5fc69d89cf1269e1f1
---
M src/widgets/CapsuleMultiselectWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/39/332739/1

diff --git a/src/widgets/CapsuleMultiselectWidget.js 
b/src/widgets/CapsuleMultiselectWidget.js
index c763669..4677a6e 100644
--- a/src/widgets/CapsuleMultiselectWidget.js
+++ b/src/widgets/CapsuleMultiselectWidget.js
@@ -806,7 +806,7 @@
 OO.ui.CapsuleMultiSelectWidget = function OoUiCapsuleMultiSelectWidget() {
OO.ui.warnDeprecation( 'CapsuleMultiSelectWidget is deprecated. Use the 
CapsuleMultiselectWidget instead.' );
// Parent constructor
-   OO.ui.TextInputMenuSelectWidget.parent.apply( this, arguments );
+   OO.ui.CapsuleMultiSelectWidget.parent.apply( this, arguments );
 };
 
 OO.inheritClass( OO.ui.CapsuleMultiSelectWidget, 
OO.ui.CapsuleMultiselectWidget );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47efa674905412d0205e0a5fc69d89cf1269e1f1
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] mediawiki...WaitConditionLoop[master]: travis: Test on PHP 7.1 too

2017-01-17 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332714 )

Change subject: travis: Test on PHP 7.1 too
..

travis: Test on PHP 7.1 too

Change-Id: I9e659bf9513d1ca9e4c448b55141ead53be8c080
---
M .travis.yml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/libs/WaitConditionLoop 
refs/changes/14/332714/1

diff --git a/.travis.yml b/.travis.yml
index 5d7b980..da7f291 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,6 +4,7 @@
   - "5.5"
   - "5.6"
   - "7.0"
+  - "7.1"
   - "hhvm"
 install:
   - composer install

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e659bf9513d1ca9e4c448b55141ead53be8c080
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/libs/WaitConditionLoop
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] CLDRPluralRuleParser[master]: readme: Fix example

2017-01-16 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332416 )

Change subject: readme: Fix example
..

readme: Fix example

Use $index instead of $i: the latter is incorrect and
causes "PHP Notice:  Undefined offset: 2".

Change-Id: I57f0317bf5180520a628968ac3ecfe5cd8407b3f
---
M README.md
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/CLDRPluralRuleParser 
refs/changes/16/332416/1

diff --git a/README.md b/README.md
index 6f37ca9..c921565 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@
 
 for ( $i = 0; $i < 3; $i++ ) {
$index = Evaluator::evaluate( $i, $rules );
-   echo "This code has $i {$forms[$i]}\n";
+   echo "This code has $i {$forms[$index]}\n";
 }
 
 // This code has 0 syntax errors

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57f0317bf5180520a628968ac3ecfe5cd8407b3f
Gerrit-PatchSet: 1
Gerrit-Project: CLDRPluralRuleParser
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] unicodejs[master]: README.md: change Bugzilla URL to Phabricator

2017-01-15 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332155 )

Change subject: README.md: change Bugzilla URL to Phabricator
..

README.md: change Bugzilla URL to Phabricator

Change-Id: I9876682995da5781f3ffab5d1ba432e3236d22fe
---
M README.md
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/unicodejs refs/changes/55/332155/1

diff --git a/README.md b/README.md
index a462d91..92f4706 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@
 Bug tracker
 ---
 
-Found a bug? Please report it in the [issue 
tracker](https://bugzilla.wikimedia.org/enter_bug.cgi?product=Utilities=UnicodeJS)!
+Found a bug? Please report it in the [issue 
tracker](https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?project=Utilities-UnicodeJS)!
 
 Release
 --

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9876682995da5781f3ffab5d1ba432e3236d22fe
Gerrit-PatchSet: 1
Gerrit-Project: unicodejs
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] RelPath[master]: travis: Add PHP 7.1

2017-01-15 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332153 )

Change subject: travis: Add PHP 7.1
..

travis: Add PHP 7.1

Change-Id: I5652c82b8722520799b68b872dfba911d1822260
---
M .travis.yml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/RelPath refs/changes/53/332153/1

diff --git a/.travis.yml b/.travis.yml
index 8c4bb1f..4ee0465 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,6 +7,7 @@
   - "5.5"
   - "5.6"
   - "7.0"
+  - "7.1"
   - "hhvm"
 install:
   - composer install

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5652c82b8722520799b68b872dfba911d1822260
Gerrit-PatchSet: 1
Gerrit-Project: RelPath
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] IPSet[master]: travis-ci: bypass Composer ssl on PHP 5.3.3

2017-01-13 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331987 )

Change subject: travis-ci: bypass Composer ssl on PHP 5.3.3
..

travis-ci: bypass Composer ssl on PHP 5.3.3

The PHP 5.3.3 builds provided by Travis-CI do not include SSL support.
This in turn causes modern versions of Composer to fail with default
configuration. When testing under PHP 5.3.3, configure Composer to use
non-tls connections.

Copied from the cdb repository.

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


  git pull ssh://gerrit.wikimedia.org:29418/IPSet refs/changes/87/331987/1

diff --git a/.travis.yml b/.travis.yml
index f16c6c2..1aad8d1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,6 +9,8 @@
   - "7.1"
   - "hhvm"
 sudo: false
+before_install:
+  - if [ "$TRAVIS_PHP_VERSION" = "5.3.3" ]; then composer config disable-tls 
true; composer config secure-http false; fi
 install:
   - composer install
 script:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d9e00e1dee9d228c4cd0a0f251ac68d36722216
Gerrit-PatchSet: 1
Gerrit-Project: IPSet
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] cdb[master]: Remove unused "use"

2017-01-13 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331984 )

Change subject: Remove unused "use"
..

Remove unused "use"

Because of commit d49d96232f045311dc1f21bf0d7e40adf82a1f1d

Change-Id: I73dac24c9cbf2ffd91d77cd5f0911b4c5edad65f
---
M src/Reader/Hash.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/cdb refs/changes/84/331984/1

diff --git a/src/Reader/Hash.php b/src/Reader/Hash.php
index 36bbc3b..8eaf670 100644
--- a/src/Reader/Hash.php
+++ b/src/Reader/Hash.php
@@ -3,7 +3,6 @@
 namespace Cdb\Reader;
 
 use Cdb\Reader;
-use Wikimedia\Assert\Assert;
 
 /**
  * Hash implements the CdbReader interface based on an associative

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73dac24c9cbf2ffd91d77cd5f0911b4c5edad65f
Gerrit-PatchSet: 1
Gerrit-Project: cdb
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] IPSet[master]: Travis CI: test also on PHP 7.1

2017-01-10 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331488 )

Change subject: Travis CI: test also on PHP 7.1
..

Travis CI: test also on PHP 7.1

Change-Id: Ic911c3ead9589f14e930efe5a1f1c75a8921d5f2
---
M .travis.yml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/IPSet refs/changes/88/331488/1

diff --git a/.travis.yml b/.travis.yml
index 125a0c6..f16c6c2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,7 @@
   - "5.5"
   - "5.6"
   - "7.0"
+  - "7.1"
   - "hhvm"
 sudo: false
 install:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic911c3ead9589f14e930efe5a1f1c75a8921d5f2
Gerrit-PatchSet: 1
Gerrit-Project: IPSet
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] wikimedia/slimapp[master]: Fix link to GNU GPL 3.0 in README.md

2016-11-23 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Fix link to GNU GPL 3.0 in README.md
..

Fix link to GNU GPL 3.0 in README.md

Change-Id: Ie9817b917969e67d71d28f7efa7a99917d4d98b1
---
M README.md
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/slimapp 
refs/changes/92/323192/1

diff --git a/README.md b/README.md
index c48fed0..7c91483 100644
--- a/README.md
+++ b/README.md
@@ -52,4 +52,4 @@
 
 License
 ---
-[GNU GPL 3.0+](www.gnu.org/copyleft/gpl.html "GNU GPL 3.0")
+[GNU GPL 3.0+](//www.gnu.org/copyleft/gpl.html "GNU GPL 3.0")

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9817b917969e67d71d28f7efa7a99917d4d98b1
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/slimapp
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...ptable[master]: Fix for cachetools v2.0.0

2016-11-19 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Fix for cachetools v2.0.0
..

Fix for cachetools v2.0.0

ttl_cache must be imported from cachetools.func instead of cachetools

Change-Id: I6e35cad88e72cf62ed097e211837360963be3daf
---
M base.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/29/322429/1

diff --git a/base.py b/base.py
index d3cebbc..5f57bb5 100644
--- a/base.py
+++ b/base.py
@@ -22,7 +22,7 @@
 from urllib.parse import urlencode
 from urllib.request import urlopen
 
-from cachetools import ttl_cache
+from cachetools.func import ttl_cache
 
 
 @ttl_cache(maxsize=200, ttl=21600)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e35cad88e72cf62ed097e211837360963be3daf
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/ptable
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...ptable[master]: Support GET requests in get_json() and get_json_cached()

2016-10-26 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Support GET requests in get_json() and get_json_cached()
..

Support GET requests in get_json() and get_json_cached()

Get rid of separate get_json_with_get() function.

Change-Id: Ie00276e87a16a620a5410d89caaf1273ec14ec29
---
M base.py
1 file changed, 10 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/54/318054/1

diff --git a/base.py b/base.py
index 6d878f7..d3cebbc 100644
--- a/base.py
+++ b/base.py
@@ -26,23 +26,20 @@
 
 
 @ttl_cache(maxsize=200, ttl=21600)
-def get_json_cached(url, data):
+def get_json_cached(url, data, get):
 """The information is cached for 6 hours."""
-with urlopen(url, data.encode('utf-8')) as response:
+if get:
+params = ['{0}?{1}'.format(url, data)]
+else:
+params = [url, data.encode('utf-8')]
+with urlopen(*params) as response:
 raw = response.read()
 return json.loads(raw.decode('utf-8'))
 
 
-@ttl_cache(maxsize=50, ttl=21600)
-def get_json_with_get(url, url_encoded_params):
-"""Get rather than Post request - information is cached for 6 hours."""
-with urlopen("{0}?{1}".format(url, url_encoded_params)) as response:
-raw = response.read()
-return json.loads(raw.decode('utf-8'))
-
-
-def get_json(url, data):
-return get_json_cached(url, urlencode(data))
+def get_json(url, data, get=False):
+"""Wrapper for get_json_cached() with URL encoding."""
+return get_json_cached(url, urlencode(data), get)
 
 
 class PropertyAlreadySetException(Exception):
@@ -97,5 +94,5 @@
 
 @classmethod
 def get_sparql(cls, query):
-response = get_json_with_get(cls.SPARQL_API, urlencode({'query': 
query, 'format': 'json'}))
+response = get_json(cls.SPARQL_API, {'query': query, 'format': 
'json'}, get=True)
 return response['results']['bindings']

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie00276e87a16a620a5410d89caaf1273ec14ec29
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/ptable
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...ptable[master]: Get rid of fake_globals hack

2016-10-18 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Get rid of fake_globals hack
..

Get rid of fake_globals hack

Replace it with __class__.__name__ hack.

Change-Id: I52e3ac904b3bca2c39f69c10ebe8f71bbe12397b
---
M app.py
M nuclides.py
A templates/cells/ElementCell.html
A templates/cells/EmptyCell.html
A templates/cells/IndicatorCell.html
A templates/cells/NuclideCell.html
A templates/cells/TableCell.html
A templates/cells/UnknownCell.html
M templates/index.html
M templates/nuclides_common.html
10 files changed, 18 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/59/316559/1

diff --git a/app.py b/app.py
index a82ba52..a0a79b4 100644
--- a/app.py
+++ b/app.py
@@ -39,13 +39,6 @@
 element_provider_class = chemistry.SparqlElementProvider
 nuclide_provider_class = nuclides.SparqlNuclideProvider
 
-fake_globals = {'isinstance': isinstance}
-for key in ('EmptyCell', 'UnknownCell', 'ElementCell', 'IndicatorCell'):
-fake_globals[key] = getattr(chemistry, key)
-
-for key in ('NoneCell', 'NuclideCell'):
-fake_globals[key] = getattr(nuclides, key)
-
 
 @app.before_request
 def set_language():
@@ -64,7 +57,7 @@
 """Render the index page."""
 elements, table, special_series, incomplete = 
app.element_provider.get_table()
 return render_template('index.html', table=table, 
special_series=special_series,
-   incomplete=incomplete, **fake_globals)
+   incomplete=incomplete)
 
 
 @app.route('/nuclides')
@@ -89,8 +82,7 @@
 max_protons = max(map(lambda nuclide: nuclide.atomic_number, nuclides))
 return render_template(template_file, nuclide_list=nuclides,
magic_numbers=magic_numbers, 
max_neutrons=max_neutrons,
-   max_protons=max_protons, incomplete=incomplete,
-   **fake_globals)
+   max_protons=max_protons, incomplete=incomplete)
 
 
 @app.route('/license')
diff --git a/nuclides.py b/nuclides.py
index 6660201..1753145 100644
--- a/nuclides.py
+++ b/nuclides.py
@@ -37,6 +37,7 @@
 lastnnum = -1
 for nuclide in self.iter_good():
 if nuclide.atomic_number is not None and nuclide.neutron_number is 
not None:
+nuclide.__class__ = NuclideCell
 if nuclide.atomic_number > lastanum:
 lastanum = nuclide.atomic_number
 if nuclide.neutron_number > lastnnum:
@@ -52,9 +53,7 @@
 if anum not in table:
 table[anum] = {}
 for nnum in range(0, lastnnum+1):
-if nnum in table[anum]:
-table[anum][nnum].__class__ = NuclideCell
-else:
+if nnum not in table[anum]:
 table[anum][nnum] = NoneCell()
 
 return nuclides, table, incomplete
diff --git a/templates/cells/ElementCell.html b/templates/cells/ElementCell.html
new file mode 100644
index 000..1d58445
--- /dev/null
+++ b/templates/cells/ElementCell.html
@@ -0,0 +1,5 @@
+
+   {{ cell.symbol }}
+   {{ cell.label }}
+   {{ cell.number }}
+
diff --git a/templates/cells/EmptyCell.html b/templates/cells/EmptyCell.html
new file mode 100644
index 000..59c437c
--- /dev/null
+++ b/templates/cells/EmptyCell.html
@@ -0,0 +1 @@
+
diff --git a/templates/cells/IndicatorCell.html 
b/templates/cells/IndicatorCell.html
new file mode 100644
index 000..a35819d
--- /dev/null
+++ b/templates/cells/IndicatorCell.html
@@ -0,0 +1,3 @@
+
+   {{ ('' * cell.index) | safe }}
+
diff --git a/templates/cells/NuclideCell.html b/templates/cells/NuclideCell.html
new file mode 100644
index 000..7359c30
--- /dev/null
+++ b/templates/cells/NuclideCell.html
@@ -0,0 +1 @@
+{{ nuclide.label 
}}
diff --git a/templates/cells/TableCell.html b/templates/cells/TableCell.html
new file mode 100644
index 000..c15040a
--- /dev/null
+++ b/templates/cells/TableCell.html
@@ -0,0 +1 @@
+
diff --git a/templates/cells/UnknownCell.html b/templates/cells/UnknownCell.html
new file mode 100644
index 000..d892a3b
--- /dev/null
+++ b/templates/cells/UnknownCell.html
@@ -0,0 +1 @@
+?
diff --git a/templates/index.html b/templates/index.html
index a6a31be..275144c 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -3,23 +3,7 @@
//www.wikidata.org/wiki/{{ element.item_id }}
 {%- endmacro -%}
 {%- macro format_cell(cell) -%}
-   {%- if isinstance(cell, EmptyCell) -%}
-   
-   {%- elif isinstance(cell, UnknownCell) -%}
-   ?
-   {%- elif isinstance(cell, ElementCell) -%}
-   
-   {{ cell.symbol }}
-   {{ cell.label }}
-   {{ cell.number }}
-   
-   {%- elif isinstance(cell, IndicatorCell) -%}
-  

[MediaWiki-commits] [Gerrit] labs...ptable[master]: Remove 'sorted' from fake_globals

2016-10-16 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Remove 'sorted' from fake_globals
..

Remove 'sorted' from fake_globals

Added with commit 452cf1473fa2274210064d54f41d465bc8d56f2d,
not needed since commit aab63da5e88d7fddd560ee22f4044fd8460fbefb.

Change-Id: If0e174cdb8b4169f20d905270e7fbb0a98bc28a5
---
M app.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/21/316221/1

diff --git a/app.py b/app.py
index 9cf9f0b..a82ba52 100644
--- a/app.py
+++ b/app.py
@@ -39,7 +39,7 @@
 element_provider_class = chemistry.SparqlElementProvider
 nuclide_provider_class = nuclides.SparqlNuclideProvider
 
-fake_globals = {'isinstance': isinstance, 'sorted': sorted}
+fake_globals = {'isinstance': isinstance}
 for key in ('EmptyCell', 'UnknownCell', 'ElementCell', 'IndicatorCell'):
 fake_globals[key] = getattr(chemistry, key)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0e174cdb8b4169f20d905270e7fbb0a98bc28a5
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/ptable
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...ptable[master]: Drop WdqBase and subclasses

2016-10-15 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Drop WdqBase and subclasses
..

Drop WdqBase and subclasses

The Wikidata Query Service is reliable and preferred to WikidataQuery.
Dropping support for the latter significantly decreases the amount of
unreachable code.

https://phabricator.wikimedia.org/T122706#2718182

Change-Id: I16584ba1304f306b54da0f9e6e21782a8f1e4a5f
---
M base.py
M chemistry.py
M nuclides.py
3 files changed, 2 insertions(+), 151 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/50/316050/1

diff --git a/base.py b/base.py
index bc01b1a..6d878f7 100644
--- a/base.py
+++ b/base.py
@@ -90,20 +90,6 @@
 raise NotImplementedError()
 
 
-class WdqBase:
-"""Load items from Wikidata Query."""
-
-WDQ_API = 'http://wdq.wmflabs.org/api'
-
-@classmethod
-def get_wdq(cls):
-return get_json(cls.WDQ_API, cls.get_query())
-
-@classmethod
-def get_query(cls):
-raise NotImplementedError()
-
-
 class SparqlBase:
 """Load items from Wikidata SPARQL query service."""
 
diff --git a/chemistry.py b/chemistry.py
index 9ea7ac7..434634c 100644
--- a/chemistry.py
+++ b/chemistry.py
@@ -22,7 +22,7 @@
 from collections import defaultdict
 
 import data
-from base import BaseProvider, PropertyAlreadySetException, SparqlBase, 
TableCell, WdqBase, get_json
+from base import BaseProvider, PropertyAlreadySetException, SparqlBase, 
TableCell, get_json
 
 
 class ElementProvider(BaseProvider):
@@ -82,55 +82,6 @@
 specials[period][i].__class__ = ElementCell  # XXX
 special_series[sindex].append(specials[period][i])
 return elements, table, special_series, incomplete
-
-
-class WdqElementProvider(WdqBase, ElementProvider):
-"""Load elements from Wikidata Query."""
-def __iter__(self):
-wdq = self.get_wdq()
-ids = ['Q%d' % item_id for item_id in wdq['items']]
-entities = self.get_entities(ids, props='labels',
- languages=self.language, 
languagefallback=1)
-elements = defaultdict(Element)
-subclass_of = defaultdict(list)
-wdq['props'] = defaultdict(list, wdq.get('props', {}))
-for item_id, datatype, value in wdq['props'][str(Element.number_pid)]:
-if datatype != 'quantity':
-continue
-value = value.split('|')
-if len(value) == 4:
-value = list(map(float, value))
-if len(set(value[:3])) == 1 and value[3] == 1 and value[0] == 
int(value[0]):
-elements[item_id].number = int(value[0])
-for item_id, datatype, value in wdq['props'][str(Element.symbol_pid)]:
-if datatype != 'string':
-continue
-elements[item_id].symbol = value
-for item_id, datatype, value in 
wdq['props'][str(Element.subclass_pid)]:
-if datatype != 'item':
-continue
-subclass_of[item_id].append(value)
-for item_id, element in elements.items():
-element.item_id = 'Q%d' % item_id
-for prop in ('number', 'symbol'):
-if not hasattr(element, prop):
-setattr(element, prop, None)
-element.load_data_from_superclasses(subclass_of[item_id])
-label = None
-entity = entities.get(element.item_id)
-if entity and 'labels' in entity and len(entity['labels']) == 1:
-label = list(entity['labels'].values())[0]['value']
-element.label = label
-yield element
-
-@classmethod
-def get_query(cls):
-pids = [str(getattr(Element, name))
-for name in ('symbol_pid', 'subclass_pid', 'number_pid')]
-return {
-'q': 'claim[%d]' % Element.symbol_pid,
-'props': ','.join(pids)
-}
 
 
 class SparqlElementProvider(SparqlBase, ElementProvider):
diff --git a/nuclides.py b/nuclides.py
index d094b0c..bdc5fc6 100644
--- a/nuclides.py
+++ b/nuclides.py
@@ -22,7 +22,7 @@
 import operator
 from collections import defaultdict
 
-from base import BaseProvider, WdqBase, SparqlBase, 
PropertyAlreadySetException, TableCell
+from base import BaseProvider, SparqlBase, PropertyAlreadySetException, 
TableCell
 from units import time_in_seconds_from_claim, time_in_seconds
 
 
@@ -219,92 +219,6 @@
 magic_number = magic_result['magic_number']['value']
 magic_numbers.append(int(magic_number))
 return magic_numbers
-
-
-class WdqNuclideProvider(WdqBase, NuclideProvider):
-"""Load nuclides from Wikidata Query."""
-def __iter__(self):
-wdq = self.get_wdq()
-ids = ['Q%d' % item_id for item_id in wdq['items']]
-entities = self.get_entities(ids, props='labels|claims',
-  

[MediaWiki-commits] [Gerrit] labs...ptable[master]: Drop explicit SPARQL prefixes from queries

2016-10-15 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Drop explicit SPARQL prefixes from queries
..

Drop explicit SPARQL prefixes from queries

Most prefixes that are used in common queries are supported by the
engine without the need to explicitly specify them.

Change-Id: I9e6566fb223dd6feaab7da654b0e032b5fd48e64
---
M nuclides.py
1 file changed, 5 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/49/316049/1

diff --git a/nuclides.py b/nuclides.py
index d094b0c..c270e7f 100644
--- a/nuclides.py
+++ b/nuclides.py
@@ -117,10 +117,7 @@
 """Load nuclide info from Wikidata Sparql endpoint."""
 def __iter__(self):
 nuclides = defaultdict(Nuclide)
-nuclides_query = "PREFIX wdt:  \
-PREFIX rdfs:  \
-PREFIX wd:  \
-SELECT ?nuclide ?atomic_number ?neutron_number ?label WHERE {{ \
+nuclides_query = "SELECT ?nuclide ?atomic_number ?neutron_number 
?label WHERE {{ \
 ?nuclide wdt:P{0}/wdt:P{1}* wd:Q{2} ; \
  wdt:P{3} ?atomic_number ; \
  wdt:P{4} ?neutron_number ; \
@@ -142,9 +139,7 @@
 nuclides[nuclide_uri].half_life = None
 nuclides[nuclide_uri].item_id = nuclide_uri.split('/')[-1]
 
-stable_query = "PREFIX wdt:  \
-PREFIX wd:  \
-SELECT ?nuclide WHERE {{ \
+stable_query = "SELECT ?nuclide WHERE {{ \
 ?nuclide wdt:P{0}/wdt:P{1}* wd:Q{2} ; \
  wdt:P{0} wd:Q{3} . \
 }}".format(Nuclide.instance_pid, Nuclide.subclass_pid, Nuclide.isotope_qid,
@@ -155,12 +150,7 @@
 if nuclide_uri in nuclides:
 nuclides[nuclide_uri].classes.append('stable')
 
-hl_query = "PREFIX wdt:  \
-PREFIX wd:  \
-PREFIX wikibase:  \
-PREFIX psv:  \
-PREFIX p:  \
-SELECT ?nuclide ?half_life ?half_life_unit WHERE {{ \
+hl_query = "SELECT ?nuclide ?half_life ?half_life_unit WHERE {{ \
 ?nuclide wdt:P{0}/wdt:P{1}* wd:Q{2} ; \
  p:P{3} ?hl_statement . \
 ?hl_statement psv:P{3} ?hl_value . \
@@ -181,12 +171,7 @@
 nuclide_result['half_life_unit']['value'])
 # else - sparql returned more than 1 half-life value - problem?
 
-decay_query = "PREFIX ps:  \
-PREFIX pq:  \
-PREFIX p:  \
-PREFIX wdt:  \
-PREFIX wd:  \
-SELECT ?nuclide ?decay_to ?decay_mode ?fraction WHERE {{ \
+decay_query = "SELECT ?nuclide ?decay_to ?decay_mode ?fraction WHERE 
{{ \
 ?nuclide wdt:P{0}/wdt:P{1}* wd:Q{2} ; \
  p:P{3} ?decay_statement . \
 ?decay_statement ps:P{3} ?decay_to ; \
@@ -206,9 +191,7 @@
 yield nuclide
 
 def get_magic_numbers(self):
-magic_query = "PREFIX wdt:  \
-PREFIX wd:  \
-SELECT ?magic_number WHERE {{ \
+magic_query = "SELECT ?magic_number WHERE {{ \
 ?number wdt:P{0} wd:Q{1} ; \
 wdt:P{2} ?magic_number . \
 }} ORDER by ?magic_number".format(Nuclide.instance_pid, Nuclide.magic_qid,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e6566fb223dd6feaab7da654b0e032b5fd48e64
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/ptable
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...ptable[master]: Add and use SparqlElementProvider

2016-10-13 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Add and use SparqlElementProvider
..

Add and use SparqlElementProvider

Bug: T122706
Change-Id: I19fd9f9c18cf17856413eb1753875c91ee591100
---
M app.py
M chemistry.py
2 files changed, 46 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/71/315671/1

diff --git a/app.py b/app.py
index 4cc..9cf9f0b 100644
--- a/app.py
+++ b/app.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-Copyright © 2012-2015 Ricordisamoa
+Copyright © 2012-2016 Ricordisamoa
 
 This file is part of the Wikidata periodic table.
 
@@ -36,7 +36,7 @@
 app.json_encoder = CustomJSONEncoder
 
 # May be set to chemistry.ApiElementProvider (slower, but more up-to-date)
-element_provider_class = chemistry.WdqElementProvider
+element_provider_class = chemistry.SparqlElementProvider
 nuclide_provider_class = nuclides.SparqlNuclideProvider
 
 fake_globals = {'isinstance': isinstance, 'sorted': sorted}
diff --git a/chemistry.py b/chemistry.py
index af58b82..cde8a9d 100644
--- a/chemistry.py
+++ b/chemistry.py
@@ -22,7 +22,7 @@
 from collections import defaultdict
 
 import data
-from base import BaseProvider, PropertyAlreadySetException, TableCell, 
WdqBase, get_json
+from base import BaseProvider, PropertyAlreadySetException, SparqlBase, 
TableCell, WdqBase, get_json
 
 
 class ElementProvider(BaseProvider):
@@ -133,6 +133,49 @@
 }
 
 
+class SparqlElementProvider(SparqlBase, ElementProvider):
+"""Load elements from Wikidata Sparql endpoint."""
+def __iter__(self):
+query = 'SELECT ?item ?symbol ?number (group_concat(?subclass_of) as 
?subclass_of) \
+WHERE {{ \
+   ?item wdt:P{symbol_pid} ?symbol . \
+   OPTIONAL {{ \
+   ?item wdt:P{subclass_pid} ?subclass_of \
+   }} \
+   OPTIONAL {{ \
+   ?item wdt:P{number_pid} ?number \
+   }} \
+}} \
+GROUP BY ?item ?symbol ?number'.format(symbol_pid=Element.symbol_pid, 
subclass_pid=Element.subclass_pid, number_pid=Element.number_pid)
+items = self.get_sparql(query)
+ids = 
[item['item']['value'].replace('http://www.wikidata.org/entity/', '') for item 
in items]
+entities = self.get_entities(ids, props='labels',
+ languages=self.language, 
languagefallback=1)
+for item in items:
+element = Element()
+element.item_id = 
item['item']['value'].replace('http://www.wikidata.org/entity/', '')
+if 'number' in item and item['number']['value'].isdigit():
+element.number = int(item['number']['value'])
+else:
+element.number = None
+if 'symbol' in item:
+element.symbol = item['symbol']['value']
+else:
+element.symbol = None
+if 'subclass_of' in item:
+subclass_of = 
[int(subclass_id.replace('http://www.wikidata.org/entity/Q', ''))
+   for subclass_id in 
item['subclass_of']['value'].split()]
+else:
+subclass_of = []
+element.load_data_from_superclasses(subclass_of)
+label = None
+entity = entities.get(element.item_id)
+if entity and 'labels' in entity and len(entity['labels']) == 1:
+label = list(entity['labels'].values())[0]['value']
+element.label = label
+yield element
+
+
 class ApiElementProvider(ElementProvider):
 """Load elements from the Wikidata API."""
 def __iter__(self):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I19fd9f9c18cf17856413eb1753875c91ee591100
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/ptable
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...translatemplate[master]: All text is Unicode by default in Python 3

2016-10-13 Thread Ricordisamoa (Code Review)
Ricordisamoa has submitted this change and it was merged.

Change subject: All text is Unicode by default in Python 3
..


All text is Unicode by default in Python 3

Change-Id: I53ae836c70a76bb8f59a35c4ffcedca500ec2f65
---
M mappings.py
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Ricordisamoa: Verified; Looks good to me, approved



diff --git a/mappings.py b/mappings.py
index 3ed4f47..a6b3265 100644
--- a/mappings.py
+++ b/mappings.py
@@ -22,7 +22,7 @@
 
 import mwparserfromhell
 
-MARKER = u'\ue0ff'
+MARKER = '\ue0ff'
 WIKIPEDIA_API = 'https://{}.wikipedia.org/w/api.php'
 DBPEDIA_API = 'http://mappings.dbpedia.org/api.php'
 
@@ -34,7 +34,7 @@
 for template in wikitext.ifilter_templates():
 templates.append(template.name.strip())
 
-prefixed_titles = [u'Template:{}'.format(title) for title in templates]
+prefixed_titles = ['Template:{}'.format(title) for title in templates]
 
 old_langlinks = get_langlinks(prefixed_titles, lang_from, lang_to)
 langlinks = {}
@@ -186,7 +186,7 @@
 titles = {}
 for lang, templates in cnf.items():
 for template in templates:
-titles[u'Mapping {lang}:{title}'.format(lang=lang, 
title=template)] = (lang, template)
+titles['Mapping {lang}:{title}'.format(lang=lang, title=template)] 
= (lang, template)
 pages = get_page_contents(DBPEDIA_API, titles.keys())
 templates = {
 lang_from: {},

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I53ae836c70a76bb8f59a35c4ffcedca500ec2f65
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/translatemplate
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 
Gerrit-Reviewer: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...translatemplate[master]: All text is Unicode by default in Python 3

2016-10-13 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: All text is Unicode by default in Python 3
..

All text is Unicode by default in Python 3

Change-Id: I53ae836c70a76bb8f59a35c4ffcedca500ec2f65
---
M mappings.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/translatemplate 
refs/changes/65/315665/1

diff --git a/mappings.py b/mappings.py
index 3ed4f47..a6b3265 100644
--- a/mappings.py
+++ b/mappings.py
@@ -22,7 +22,7 @@
 
 import mwparserfromhell
 
-MARKER = u'\ue0ff'
+MARKER = '\ue0ff'
 WIKIPEDIA_API = 'https://{}.wikipedia.org/w/api.php'
 DBPEDIA_API = 'http://mappings.dbpedia.org/api.php'
 
@@ -34,7 +34,7 @@
 for template in wikitext.ifilter_templates():
 templates.append(template.name.strip())
 
-prefixed_titles = [u'Template:{}'.format(title) for title in templates]
+prefixed_titles = ['Template:{}'.format(title) for title in templates]
 
 old_langlinks = get_langlinks(prefixed_titles, lang_from, lang_to)
 langlinks = {}
@@ -186,7 +186,7 @@
 titles = {}
 for lang, templates in cnf.items():
 for template in templates:
-titles[u'Mapping {lang}:{title}'.format(lang=lang, 
title=template)] = (lang, template)
+titles['Mapping {lang}:{title}'.format(lang=lang, title=template)] 
= (lang, template)
 pages = get_page_contents(DBPEDIA_API, titles.keys())
 templates = {
 lang_from: {},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I53ae836c70a76bb8f59a35c4ffcedca500ec2f65
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/translatemplate
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...translatemplate[master]: Add proper User-Agent header to every request

2016-10-07 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Add proper User-Agent header to every request
..

Add proper User-Agent header to every request

Tool name, URL, email address for maintainers, major and
minor Python version:
https://www.mediawiki.org/wiki/?oldid=2220062#Identifying_your_client
https://wikitech.wikimedia.org/wiki/?oldid=880016#Email

Change-Id: I0db1d0cde1c4bd5808f0df5538fb4201b83f43af
---
M mappings.py
1 file changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/translatemplate 
refs/changes/84/314684/1

diff --git a/mappings.py b/mappings.py
index 3ed4f47..db66e38 100644
--- a/mappings.py
+++ b/mappings.py
@@ -17,14 +17,20 @@
 
 import json
 from collections import Counter
+import sys
 from urllib.parse import urlencode
-from urllib.request import urlopen
+from urllib.request import Request, urlopen
 
 import mwparserfromhell
 
 MARKER = u'\ue0ff'
 WIKIPEDIA_API = 'https://{}.wikipedia.org/w/api.php'
 DBPEDIA_API = 'http://mappings.dbpedia.org/api.php'
+REQUEST_HEADERS = {
+'User-Agent': 'Template translator 
(https://tools.wmflabs.org/translatemplate/; '
+  'translatemplate.maintainers@'
+  'tools.wmflabs.org) 
Python-urllib/{}.{}'.format(*sys.version_info)
+}
 
 
 def translate_templates(wikitext, lang_from, lang_to, shood_has_marker=True):
@@ -116,7 +122,8 @@
 
 
 def get_json(url, data):
-with urlopen(url, urlencode(data).encode('utf-8')) as response:
+req = Request(url, urlencode(data).encode('utf-8'), 
headers=REQUEST_HEADERS)
+with urlopen(req) as response:
 raw = response.read()
 return json.loads(raw.decode('utf-8'))
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0db1d0cde1c4bd5808f0df5538fb4201b83f43af
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/translatemplate
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...translatemplate[master]: Update Bootstrap from 3.3.6 to 3.3.7, jQuery from 2.1.4 to 3...

2016-09-22 Thread Ricordisamoa (Code Review)
Ricordisamoa has submitted this change and it was merged.

Change subject: Update Bootstrap from 3.3.6 to 3.3.7, jQuery from 2.1.4 to 3.1.0
..


Update Bootstrap from 3.3.6 to 3.3.7, jQuery from 2.1.4 to 3.1.0

Change-Id: Ie2a2d9f802c6a8ffeb4fc87d0c9f89e59f6b061f
---
M templates/base.html
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Ricordisamoa: Verified; Looks good to me, approved



diff --git a/templates/base.html b/templates/base.html
index c0332e5..279a18a 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -4,13 +4,13 @@
 
 {% block title %}{% endblock %}
 
-
+
 
 
-
+
 
 
-
+
 {% block head %}{% endblock -%}
 
 {% block content %}{% endblock %}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie2a2d9f802c6a8ffeb4fc87d0c9f89e59f6b061f
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/translatemplate
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 
Gerrit-Reviewer: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...translatemplate[master]: Update Bootstrap from 3.3.6 to 3.3.7, jQuery from 2.1.4 to 3...

2016-09-22 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Update Bootstrap from 3.3.6 to 3.3.7, jQuery from 2.1.4 to 3.1.0
..

Update Bootstrap from 3.3.6 to 3.3.7, jQuery from 2.1.4 to 3.1.0

Change-Id: Ie2a2d9f802c6a8ffeb4fc87d0c9f89e59f6b061f
---
M templates/base.html
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/translatemplate 
refs/changes/50/312250/1

diff --git a/templates/base.html b/templates/base.html
index c0332e5..279a18a 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -4,13 +4,13 @@
 
 {% block title %}{% endblock %}
 
-
+
 
 
-
+
 
 
-
+
 {% block head %}{% endblock -%}
 
 {% block content %}{% endblock %}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2a2d9f802c6a8ffeb4fc87d0c9f89e59f6b061f
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/translatemplate
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...ptable[master]: Access Wikidata API via HTTPS

2016-09-22 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Access Wikidata API via HTTPS
..

Access Wikidata API via HTTPS

urllib.error.HTTPError: HTTP Error 403: Insecure Request Forbidden - use HTTPS
 - 
https://lists.wikimedia.org/pipermail/mediawiki-api-announce/2016-May/000110.html

Bug: T142432
Change-Id: I0222113d987b64d8b34bb56be4c74f1388322a4b
---
M base.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ptable 
refs/changes/00/312200/1

diff --git a/base.py b/base.py
index c098026..bc01b1a 100644
--- a/base.py
+++ b/base.py
@@ -56,7 +56,7 @@
 class BaseProvider:
 """Base class for all providers."""
 
-WD_API = 'http://www.wikidata.org/w/api.php'
+WD_API = 'https://www.wikidata.org/w/api.php'
 API_LIMIT = 50
 
 def __init__(self, language):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0222113d987b64d8b34bb56be4c74f1388322a4b
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/ptable
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...translatemplate[master]: Access Wikipedia API via HTTPS

2016-09-22 Thread Ricordisamoa (Code Review)
Ricordisamoa has submitted this change and it was merged.

Change subject: Access Wikipedia API via HTTPS
..


Access Wikipedia API via HTTPS

urllib.error.HTTPError: HTTP Error 403: Insecure Request Forbidden - use HTTPS
 - 
https://lists.wikimedia.org/pipermail/mediawiki-api-announce/2016-May/000110.html

Change-Id: Ib2f7e96ad40d2080b479c3f953f201b318f6c439
---
M mappings.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Ricordisamoa: Verified; Looks good to me, approved



diff --git a/mappings.py b/mappings.py
index e4d513b..3ed4f47 100644
--- a/mappings.py
+++ b/mappings.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-Copyright 2015 Ricordisamoa
+Copyright 2015-2016 Ricordisamoa
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
 import mwparserfromhell
 
 MARKER = u'\ue0ff'
-WIKIPEDIA_API = 'http://{}.wikipedia.org/w/api.php'
+WIKIPEDIA_API = 'https://{}.wikipedia.org/w/api.php'
 DBPEDIA_API = 'http://mappings.dbpedia.org/api.php'
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib2f7e96ad40d2080b479c3f953f201b318f6c439
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/translatemplate
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 
Gerrit-Reviewer: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] labs...translatemplate[master]: Access Wikipedia API via HTTPS

2016-09-22 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Access Wikipedia API via HTTPS
..

Access Wikipedia API via HTTPS

urllib.error.HTTPError: HTTP Error 403: Insecure Request Forbidden - use HTTPS
 - 
https://lists.wikimedia.org/pipermail/mediawiki-api-announce/2016-May/000110.html

Change-Id: Ib2f7e96ad40d2080b479c3f953f201b318f6c439
---
M mappings.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/translatemplate 
refs/changes/95/312195/1

diff --git a/mappings.py b/mappings.py
index e4d513b..3ed4f47 100644
--- a/mappings.py
+++ b/mappings.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 """
-Copyright 2015 Ricordisamoa
+Copyright 2015-2016 Ricordisamoa
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
 import mwparserfromhell
 
 MARKER = u'\ue0ff'
-WIKIPEDIA_API = 'http://{}.wikipedia.org/w/api.php'
+WIKIPEDIA_API = 'https://{}.wikipedia.org/w/api.php'
 DBPEDIA_API = 'http://mappings.dbpedia.org/api.php'
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2f7e96ad40d2080b479c3f953f201b318f6c439
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/translatemplate
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Use "csrf" tokens instead of "edit" ones - change (mediawiki...Thanks)

2016-05-26 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Use "csrf" tokens instead of "edit" ones
..

Use "csrf" tokens instead of "edit" ones

"edit" type tokens have been deprecated in favour of the
more generic "csrf" type tokens.
This has been causing warnings since: 65077ede90

See also https://www.mediawiki.org/wiki/API:Tokens

Bug: T134532
Change-Id: I3ce3c1e6a40f8a21c931c77314021e2ae94e5fb7
---
M modules/ext.thanks.flowthank.js
M modules/ext.thanks.mobilediff.js
M modules/ext.thanks.revthank.js
3 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/modules/ext.thanks.flowthank.js b/modules/ext.thanks.flowthank.js
index c1eb6a4..e6c8f45 100644
--- a/modules/ext.thanks.flowthank.js
+++ b/modules/ext.thanks.flowthank.js
@@ -34,7 +34,7 @@
}
 
function sendFlowThanks( $thankLink ) {
-   ( new mw.Api() ).postWithToken( 'edit', {
+   ( new mw.Api() ).postWithToken( 'csrf', {
action: 'flowthank',
postid: $thankLink.closest( '.flow-post' ).attr( 
mw.thanks.thanked.attrName )
} )
diff --git a/modules/ext.thanks.mobilediff.js b/modules/ext.thanks.mobilediff.js
index d084395..3f78e2d 100644
--- a/modules/ext.thanks.mobilediff.js
+++ b/modules/ext.thanks.mobilediff.js
@@ -10,7 +10,7 @@
 */
function thankUser( name, revision, gender ) {
var d = $.Deferred();
-   ( new mw.Api() ).postWithToken( 'edit', {
+   ( new mw.Api() ).postWithToken( 'csrf', {
action: 'thank',
rev: revision,
source: 'mobilediff'
diff --git a/modules/ext.thanks.revthank.js b/modules/ext.thanks.revthank.js
index 3bc5069..a28da6e 100644
--- a/modules/ext.thanks.revthank.js
+++ b/modules/ext.thanks.revthank.js
@@ -28,7 +28,7 @@
source = 'diff';
}
 
-   ( new mw.Api ).postWithToken( 'edit', {
+   ( new mw.Api ).postWithToken( 'csrf', {
action: 'thank',
rev: $thankLink.attr( 'data-revision-id' ),
source: source

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ce3c1e6a40f8a21c931c77314021e2ae94e5fb7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Thanks
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Unswap langcode and langdir variables in popup.mustache - change (mediawiki...Popups)

2016-05-19 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Unswap langcode and langdir variables in popup.mustache
..

Unswap langcode and langdir variables in popup.mustache

Broken by commit 27d811a1737e64f3aa26361337297b8a9f2b5b03

Bug: T135758
Change-Id: Ia9b92b4c91e54f921ad220b7818af6f245e29b61
---
M resources/popup.mustache
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/14/289814/1

diff --git a/resources/popup.mustache b/resources/popup.mustache
index 163de28..064e85e 100644
--- a/resources/popup.mustache
+++ b/resources/popup.mustache
@@ -2,7 +2,7 @@
{{#hasThumbnail}}

{{/hasThumbnail}}
-   
+   

{{lastModified}}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9b92b4c91e54f921ad220b7818af6f245e29b61
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Add mediawiki/mediawiki-codesniffer - change (mediawiki...Scribunto)

2016-05-16 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Add mediawiki/mediawiki-codesniffer
..

Add mediawiki/mediawiki-codesniffer

Failing rules are disabled for now.

Change-Id: I9c4cbd7865a0793703b3ca39045087c5ab691bd1
---
M composer.json
A phpcs.xml
2 files changed, 67 insertions(+), 2 deletions(-)


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

diff --git a/composer.json b/composer.json
index 0cc4484..b8e4c6b 100644
--- a/composer.json
+++ b/composer.json
@@ -17,11 +17,13 @@
"composer/installers" : ">=1.0.1"
},
"require-dev": {
-   "jakub-onderka/php-parallel-lint": "0.9.2"
+   "jakub-onderka/php-parallel-lint": "0.9.2",
+   "mediawiki/mediawiki-codesniffer": "0.7.1"
},
"scripts": {
"test": [
-   "parallel-lint . --exclude vendor"
+   "parallel-lint . --exclude vendor",
+   "phpcs"
]
}
 }
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 000..41715e6
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,63 @@
+
+
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   .
+   
+   node_modules/
+   vendor/
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c4cbd7865a0793703b3ca39045087c5ab691bd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] build: Bump devDependencies to latest - change (mediawiki...Babel)

2016-05-13 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: build: Bump devDependencies to latest
..

build: Bump devDependencies to latest

 grunt  0.4.5  →  1.0.1
 grunt-cli 0.1.13  →  1.2.0
 grunt-banana-checker   0.4.0  →  0.5.0

Change-Id: If4ce78032ddf41f576863e6f822ca8ad22a9c252
---
M package.json
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/package.json b/package.json
index 53f5214..a963388 100644
--- a/package.json
+++ b/package.json
@@ -7,9 +7,9 @@
 "test": "grunt test"
   },
   "devDependencies": {
-"grunt": "0.4.5",
-"grunt-cli": "0.1.13",
+"grunt": "1.0.1",
+"grunt-cli": "1.2.0",
 "grunt-jsonlint": "1.0.7",
-"grunt-banana-checker": "0.4.0"
+"grunt-banana-checker": "0.5.0"
   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4ce78032ddf41f576863e6f822ca8ad22a9c252
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Put BabelBox interface and implementations into a namespace - change (mediawiki...Babel)

2016-05-13 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Put BabelBox interface and implementations into a namespace
..

Put BabelBox interface and implementations into a namespace

MediaWiki\Babel\BabelBox for the record.

Change-Id: I9e41f80f64ebadcc56df6513fa4ba0bb807564f9
---
M Babel.class.php
M BabelBox/BabelBox.php
M BabelBox/LanguageBabelBox.php
M BabelBox/NotBabelBox.php
M BabelBox/NullBabelBox.php
M extension.json
6 files changed, 22 insertions(+), 4 deletions(-)


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

diff --git a/Babel.class.php b/Babel.class.php
index ca86574..9b6eb7b 100644
--- a/Babel.class.php
+++ b/Babel.class.php
@@ -13,6 +13,10 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
+use MediaWiki\Babel\BabelBox\LanguageBabelBox;
+use MediaWiki\Babel\BabelBox\NotBabelBox;
+use MediaWiki\Babel\BabelBox\NullBabelBox;
+
 /**
  * Main class for the Babel extension.
  */
diff --git a/BabelBox/BabelBox.php b/BabelBox/BabelBox.php
index 474310a..5a533e4 100644
--- a/BabelBox/BabelBox.php
+++ b/BabelBox/BabelBox.php
@@ -6,6 +6,8 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
+namespace MediaWiki\Babel\BabelBox;
+
 /**
  * Interface for babel boxes.
  */
diff --git a/BabelBox/LanguageBabelBox.php b/BabelBox/LanguageBabelBox.php
index 5394985..6a64b29 100644
--- a/BabelBox/LanguageBabelBox.php
+++ b/BabelBox/LanguageBabelBox.php
@@ -13,6 +13,14 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
+namespace MediaWiki\Babel\BabelBox;
+
+use Babel;
+use BabelAutoCreate;
+use BabelLanguageCodes;
+use Language;
+use Title;
+
 /**
  * Class for babel language boxes.
  */
diff --git a/BabelBox/NotBabelBox.php b/BabelBox/NotBabelBox.php
index f251c22..cc29781 100644
--- a/BabelBox/NotBabelBox.php
+++ b/BabelBox/NotBabelBox.php
@@ -13,6 +13,8 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
+namespace MediaWiki\Babel\BabelBox;
+
 /**
  * Class for inner items which are not babel boxes.
  */
diff --git a/BabelBox/NullBabelBox.php b/BabelBox/NullBabelBox.php
index ca67d44..b83 100644
--- a/BabelBox/NullBabelBox.php
+++ b/BabelBox/NullBabelBox.php
@@ -6,6 +6,8 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
+namespace MediaWiki\Babel\BabelBox;
+
 /**
  * Class for inner items which render as empty strings.
  */
diff --git a/extension.json b/extension.json
index 57ecd40..e4b3acc 100644
--- a/extension.json
+++ b/extension.json
@@ -19,10 +19,10 @@
"BabelLanguageCodes": "BabelLanguageCodes.class.php",
"BabelStatic": "BabelStatic.class.php",
"BabelAutoCreate": "BabelAutoCreate.class.php",
-   "BabelBox": "BabelBox/BabelBox.php",
-   "LanguageBabelBox": "BabelBox/LanguageBabelBox.php",
-   "NotBabelBox": "BabelBox/NotBabelBox.php",
-   "NullBabelBox": "BabelBox/NullBabelBox.php"
+   "MediaWiki\\Babel\\BabelBox\\BabelBox": "BabelBox/BabelBox.php",
+   "MediaWiki\\Babel\\BabelBox\\LanguageBabelBox": 
"BabelBox/LanguageBabelBox.php",
+   "MediaWiki\\Babel\\BabelBox\\NotBabelBox": 
"BabelBox/NotBabelBox.php",
+   "MediaWiki\\Babel\\BabelBox\\NullBabelBox": 
"BabelBox/NullBabelBox.php"
},
"ResourceModules": {
"ext.babel": {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e41f80f64ebadcc56df6513fa4ba0bb807564f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] PHPCS: reenable some Generic rules and make pass - change (mediawiki...ProofreadPage)

2016-05-09 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: PHPCS: reenable some Generic rules and make pass
..

PHPCS: reenable some Generic rules and make pass

Change-Id: I62470652a65962a8e546f49c2ff84b480947149b
---
M SpecialProofreadPages.php
M includes/Parser/PagesTagParser.php
M includes/index/ProofreadIndexPage.php
M phpcs.xml
4 files changed, 5 insertions(+), 9 deletions(-)


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

diff --git a/SpecialProofreadPages.php b/SpecialProofreadPages.php
index 4a9df3c..a4cd9a9 100644
--- a/SpecialProofreadPages.php
+++ b/SpecialProofreadPages.php
@@ -96,7 +96,7 @@
}
 
function reallyDoQuery( $limit, $offset = false ) {
-   $count = sizeof( $this->searchList );
+   $count = count( $this->searchList );
if ( $count > $this->limit ) { //Delete the last item to avoid 
the sort done by reallyDoQuery move it to another position than the last
$this->addOne = true;
unset( $this->searchList[ $count - 1 ] );
diff --git a/includes/Parser/PagesTagParser.php 
b/includes/Parser/PagesTagParser.php
index f44839b..2b59051 100644
--- a/includes/Parser/PagesTagParser.php
+++ b/includes/Parser/PagesTagParser.php
@@ -254,7 +254,8 @@
$h_out = '{{:MediaWiki:Proofreadpage_header_template';
$h_out .= "|value=$header";
// find next and previous pages in list
-   for ( $i = 0; $i < count( $indexLinks ); $i++ ) {
+   $indexLinksCount = count( $indexLinks );
+   for ( $i = 0; $i < $indexLinksCount; $i++ ) {
if ( $pageTitle->equals( $indexLinks[$i][0] ) ) 
{
$current = '[[' . 
$indexLinks[$i][0]->getFullText() . '|' . $indexLinks[$i][1] . ']]';
break;
diff --git a/includes/index/ProofreadIndexPage.php 
b/includes/index/ProofreadIndexPage.php
index 9f2e6cf..c257074 100644
--- a/includes/index/ProofreadIndexPage.php
+++ b/includes/index/ProofreadIndexPage.php
@@ -333,7 +333,8 @@
preg_match_all( '/\[\[(.*?)(\|(.*?)|)\]\]/i', $text, 
$textLinks, PREG_PATTERN_ORDER );
$links = array();
$num = 0;
-   for ( $i = 0; $i < count( $textLinks[1] ); $i++ ) {
+   $textLinksCount = count( $textLinks[1] );
+   for ( $i = 0; $i < $textLinksCount; $i++ ) {
$title = Title::newFromText( $textLinks[1][$i] );
if ( $title !== null && $title->inNamespace( $namespace 
) ) {
if ( $textLinks[3][$i] === '' ) {
diff --git a/phpcs.xml b/phpcs.xml
index ebdcf88..35c9742 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -4,16 +4,10 @@

0

-   
-   0
-   

0


-   0
-   
-   
0



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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I62470652a65962a8e546f49c2ff84b480947149b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] PHPCS: reenable Generic.ControlStructures and make pass - change (mediawiki...ProofreadPage)

2016-05-09 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: PHPCS: reenable Generic.ControlStructures and make pass
..

PHPCS: reenable Generic.ControlStructures and make pass

Change-Id: I63b5eea8df632df727f1c1b6d0c51d432dccac89
---
M includes/index/ProofreadIndexEntry.php
M includes/index/oai/SpecialProofreadIndexOai.php
M phpcs.xml
3 files changed, 10 insertions(+), 8 deletions(-)


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

diff --git a/includes/index/ProofreadIndexEntry.php 
b/includes/index/ProofreadIndexEntry.php
index 25572d2..d32a465 100644
--- a/includes/index/ProofreadIndexEntry.php
+++ b/includes/index/ProofreadIndexEntry.php
@@ -51,10 +51,12 @@
$this->key = $key;
$this->value = trim( $value );
$this->config = $config;
-   if ( isset( $this->config['type'] ) )
+   if ( isset( $this->config['type'] ) ) {
$this->config['type'] = strtolower( 
$this->config['type'] );
-   if ( isset( $this->config['data'] ) )
+   }
+   if ( isset( $this->config['data'] ) ) {
$this->config['data'] = strtolower( 
$this->config['data'] );
+   }
}
 
/**
@@ -247,8 +249,9 @@
 * @return string
 */
public function getQualifiedDublinCoreProperty() {
-   if ( !isset( $this->config['data'] ) || !$this->config['data'] )
+   if ( !isset( $this->config['data'] ) || !$this->config['data'] 
) {
return null;
+   }
 
switch ( $this->config['data'] ) {
case 'year':
diff --git a/includes/index/oai/SpecialProofreadIndexOai.php 
b/includes/index/oai/SpecialProofreadIndexOai.php
index 16b18a4..d705112 100644
--- a/includes/index/oai/SpecialProofreadIndexOai.php
+++ b/includes/index/oai/SpecialProofreadIndexOai.php
@@ -242,10 +242,12 @@
echo Xml::element( 'earliestDatestamp', null, self::datestamp( 
$this->earliestDatestamp() ) ) . "\n";
echo Xml::element( 'deletedRecord', null, 'no' ) . "\n";
echo Xml::element( 'granularity', null, '-MM-DDThh:mm:ssZ' 
) . "\n";
-   if ( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) && strpos( 
$_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) !== false )
+   if ( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) && strpos( 
$_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) !== false ) {
echo Xml::element( 'compression', null, 'gzip' ) . "\n";
-   if ( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) && strpos( 
$_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate' ) !== false )
+   }
+   if ( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) && strpos( 
$_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate' ) !== false ) {
echo Xml::element( 'compression', null, 'deflate' ) . 
"\n";
+   }
}
 
/**
diff --git a/phpcs.xml b/phpcs.xml
index 6d331c7..ebdcf88 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -7,9 +7,6 @@

0

-   
-   0
-   

0


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63b5eea8df632df727f1c1b6d0c51d432dccac89
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] PHPCS: reenable minor space-related rules and make pass - change (mediawiki...ProofreadPage)

2016-05-09 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: PHPCS: reenable minor space-related rules and make pass
..

PHPCS: reenable minor space-related rules and make pass

Change-Id: I7f7fc864c736ee1603f27de69cfdf4f96aa96199
---
M SpecialProofreadPages.php
M includes/Parser/PagesTagParser.php
M includes/index/EditProofreadIndexPage.php
M includes/page/PageContent.php
M includes/page/ProofreadPageDbConnector.php
M phpcs.xml
6 files changed, 7 insertions(+), 20 deletions(-)


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

diff --git a/SpecialProofreadPages.php b/SpecialProofreadPages.php
index ec279ad..4a9df3c 100644
--- a/SpecialProofreadPages.php
+++ b/SpecialProofreadPages.php
@@ -184,8 +184,8 @@
return '';
}
$plink = $this->isCached()
-   ? Linker::link( $title , htmlspecialchars( 
$title->getText() ) )
-   : Linker::linkKnown( $title , htmlspecialchars( 
$title->getText() ) );
+   ? Linker::link( $title, htmlspecialchars( 
$title->getText() ) )
+   : Linker::linkKnown( $title, htmlspecialchars( 
$title->getText() ) );
 
if ( !$title->exists() ) {
return "{$plink}";
diff --git a/includes/Parser/PagesTagParser.php 
b/includes/Parser/PagesTagParser.php
index 10ea3df..f44839b 100644
--- a/includes/Parser/PagesTagParser.php
+++ b/includes/Parser/PagesTagParser.php
@@ -192,7 +192,7 @@
list( $page, $pagenum ) = $item;
$pp[] = $page->getDBkey();
}
-   $cat = str_replace( ' ' , '_' , wfMessage( 
'proofreadpage_quality0_category' )->inContentLanguage()->escaped() );
+   $cat = str_replace( ' ', '_', wfMessage( 
'proofreadpage_quality0_category' )->inContentLanguage()->escaped() );
$res = 
ProofreadPageDbConnector::getPagesNameInCategory( $pp, $cat );
 
if ( $res ) {
@@ -229,7 +229,7 @@
$out .= '{{:' . $text . '}}';
}
if ( !$is_q0 ) {
-   $out.= "";
+   $out .= "";
}
}
} else {
diff --git a/includes/index/EditProofreadIndexPage.php 
b/includes/index/EditProofreadIndexPage.php
index 81ee1f6..805923f 100644
--- a/includes/index/EditProofreadIndexPage.php
+++ b/includes/index/EditProofreadIndexPage.php
@@ -103,8 +103,7 @@
$inputAttributes['id'] = $key;
$inputAttributes['size'] = 60;
$out->addHTML( Html::input( $key, $val, 
$inputType, $inputAttributes ) );
-   }
-   else {
+   } else {
$inputAttributes['cols'] = 60;
$inputAttributes['rows'] = $size;
$out->addHTML( Html::textarea( $key, $val, 
$inputAttributes ) );
diff --git a/includes/page/PageContent.php b/includes/page/PageContent.php
index c4e31fa..5f86d81 100644
--- a/includes/page/PageContent.php
+++ b/includes/page/PageContent.php
@@ -67,7 +67,7 @@
 * returns the body of the page
 * @return WikitextContent
 */
-   public function getBody(){
+   public function getBody() {
return $this->body;
}
 
diff --git a/includes/page/ProofreadPageDbConnector.php 
b/includes/page/ProofreadPageDbConnector.php
index 3375c7f..35ea1d8 100644
--- a/includes/page/ProofreadPageDbConnector.php
+++ b/includes/page/ProofreadPageDbConnector.php
@@ -63,7 +63,7 @@
 */
public static function queryCount( $query, $cat ) {
$dbr = wfGetDB( DB_SLAVE );
-   $query['conds']['cl_to'] = str_replace( ' ' , '_' , wfMessage( 
$cat )->inContentLanguage()->text() );
+   $query['conds']['cl_to'] = str_replace( ' ', '_', wfMessage( 
$cat )->inContentLanguage()->text() );
$res = $dbr->select( $query['tables'], $query['fields'], 
$query['conds'], __METHOD__, array(), $query['joins'] );
 
if ( $res && $dbr->numRows( $res ) > 0 ) {
diff --git a/phpcs.xml b/phpcs.xml
index 006a75c..6d331c7 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -13,25 +13,13 @@

0

-   
-   0
-   
-   
-   0
-   

-   0
-   
-   
0


0


-   0
-   
-  

[MediaWiki-commits] [Gerrit] PHPCS: reenable PSR2.Methods.MethodDeclaration and make pass - change (mediawiki...ProofreadPage)

2016-05-09 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: PHPCS: reenable PSR2.Methods.MethodDeclaration and make pass
..

PHPCS: reenable PSR2.Methods.MethodDeclaration and make pass

Change-Id: Id957b9360fb3467fbd16cd4fd2f97df618338b1b
---
M includes/Pagination/Pagination.php
M includes/Parser/TagParser.php
M includes/index/ProofreadIndexValue.php
M phpcs.xml
4 files changed, 10 insertions(+), 13 deletions(-)


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

diff --git a/includes/Pagination/Pagination.php 
b/includes/Pagination/Pagination.php
index 50d9f65..bd629dc 100644
--- a/includes/Pagination/Pagination.php
+++ b/includes/Pagination/Pagination.php
@@ -47,7 +47,7 @@
 * @return integer
 * @throws PageNotInPaginationException
 */
-   public abstract function getPageNumber( ProofreadPagePage $page );
+   abstract public function getPageNumber( ProofreadPagePage $page );
 
/**
 * Returns the page number as it should be displayed from an internal 
page number
@@ -56,14 +56,14 @@
 * @return PageNumber
 * @throws OutOfBoundsException
 */
-   public abstract function getDisplayedPageNumber( $pageNumber );
+   abstract public function getDisplayedPageNumber( $pageNumber );
 
/**
 * Returns the number of pages
 *
 * @return integer
 */
-   public abstract function getNumberOfPages();
+   abstract public function getNumberOfPages();
 
/**
 * Returns the page number $pageNumber of the book
@@ -72,7 +72,7 @@
 * @return ProofreadPagePage
 * @throws OutOfBoundsException
 */
-   public abstract function getPage( $pageNumber );
+   abstract public function getPage( $pageNumber );
 
/**
 * Returns if a page number $pageNumber exits
@@ -80,7 +80,7 @@
 * @param integer $pageNumber page number
 * @return boolean
 */
-   protected abstract function pageNumberExists( $pageNumber );
+   abstract protected function pageNumberExists( $pageNumber );
 
/**
 * @see Iterator::rewind
diff --git a/includes/Parser/TagParser.php b/includes/Parser/TagParser.php
index e780709..678c4f7 100644
--- a/includes/Parser/TagParser.php
+++ b/includes/Parser/TagParser.php
@@ -37,7 +37,7 @@
 * @param array $args tags arguments
 * @return string
 */
-   public abstract function render( $input, array $args );
+   abstract public function render( $input, array $args );
 
/**
 * @param string $errorMsg
diff --git a/includes/index/ProofreadIndexValue.php 
b/includes/index/ProofreadIndexValue.php
index 167bb83..0c0f709 100644
--- a/includes/index/ProofreadIndexValue.php
+++ b/includes/index/ProofreadIndexValue.php
@@ -44,19 +44,19 @@
 * Set the value
 * @param string $value
 */
-   protected abstract function setValue( $value );
+   abstract protected function setValue( $value );
 
/**
 * Return the value of the entry as string
 * @return string
 */
-   public abstract function __toString();
+   abstract public function __toString();
 
/**
 * Return the type of the entry
 * @return string
 */
-   public abstract function getType();
+   abstract public function getType();
 
/**
 * Return the "main" type of the entry (all identifiers are regrouped 
under the name identifier)
@@ -395,7 +395,7 @@
 * Return the value of the entry as URI
 * @return string
 */
-   public abstract function getUri();
+   abstract public function getUri();
 
/**
 * Return the "main" type of the entry (all identifiers are regrouped 
under the name identifier)
diff --git a/phpcs.xml b/phpcs.xml
index 58e3c8a..006a75c 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -45,9 +45,6 @@

0

-   
-   0
-   

0


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id957b9360fb3467fbd16cd4fd2f97df618338b1b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] PHPCS: reenable Generic.Files.EndFileNewline.NotFound and ma... - change (mediawiki...ProofreadPage)

2016-05-09 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: PHPCS: reenable Generic.Files.EndFileNewline.NotFound and make 
pass
..

PHPCS: reenable Generic.Files.EndFileNewline.NotFound and make pass

Change-Id: I74f5cf55e257d4c4d0c85bf14978fc2ccde6d3ff
---
M includes/Context.php
M includes/DiffFormatterUtils.php
M includes/FileNotFoundException.php
M includes/FileProvider.php
M includes/Pagination/FilePagination.php
M includes/Pagination/PageList.php
M includes/Pagination/PageNotInPaginationException.php
M includes/Pagination/PageNumber.php
M includes/Pagination/PagePagination.php
M includes/Pagination/Pagination.php
M includes/Pagination/PaginationFactory.php
M includes/page/PageContentBuilder.php
M includes/page/PageDifferenceEngine.php
M includes/page/PageEditAction.php
M includes/page/PageLevel.php
M includes/page/PageSubmitAction.php
M includes/page/PageViewAction.php
M phpcs.xml
M tests/includes/ContextTest.php
M tests/includes/DiffFormatterUtilsTest.php
M tests/includes/FileProviderMock.php
M tests/includes/FileProviderTest.php
M tests/includes/Pagination/FilePaginationTest.php
M tests/includes/Pagination/PageListTest.php
M tests/includes/Pagination/PageNumberTest.php
M tests/includes/Pagination/PagePaginationTest.php
M tests/includes/Pagination/PaginationFactoryTest.php
M tests/includes/ProofreadPageTestCase.php
M tests/includes/page/PageContentBuilderTest.php
M tests/includes/page/PageContentTest.php
M tests/includes/page/ProofreadPagePageTest.php
31 files changed, 30 insertions(+), 33 deletions(-)


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

diff --git a/includes/Context.php b/includes/Context.php
index 1a8e8ce..d34bed9 100644
--- a/includes/Context.php
+++ b/includes/Context.php
@@ -96,4 +96,4 @@
 
return $defaultContext;
}
-}
\ No newline at end of file
+}
diff --git a/includes/DiffFormatterUtils.php b/includes/DiffFormatterUtils.php
index 4b7bf69..2f5e719 100644
--- a/includes/DiffFormatterUtils.php
+++ b/includes/DiffFormatterUtils.php
@@ -66,4 +66,4 @@
Html::rawelement( 'div', array(), $line ) .
Html::closeElement( 'td' );
}
-}
\ No newline at end of file
+}
diff --git a/includes/FileNotFoundException.php 
b/includes/FileNotFoundException.php
index a8cbf09..7879b6f 100644
--- a/includes/FileNotFoundException.php
+++ b/includes/FileNotFoundException.php
@@ -10,4 +10,4 @@
  * An exception thrown if a file is not found
  */
 class FileNotFoundException extends RuntimeException {
-}
\ No newline at end of file
+}
diff --git a/includes/FileProvider.php b/includes/FileProvider.php
index 6f2ba2b..0567d8d 100644
--- a/includes/FileProvider.php
+++ b/includes/FileProvider.php
@@ -62,4 +62,4 @@
Title::makeTitle( NS_IMAGE, strtok( 
$page->getTitle()->getText(), '/' ) ) //use the base name as file name
);
}
-}
\ No newline at end of file
+}
diff --git a/includes/Pagination/FilePagination.php 
b/includes/Pagination/FilePagination.php
index 3b5cf12..b482a0d 100644
--- a/includes/Pagination/FilePagination.php
+++ b/includes/Pagination/FilePagination.php
@@ -133,4 +133,4 @@
protected function pageNumberExists( $pageNumber ) {
return 1 <= $pageNumber && $pageNumber <= $this->numberOfPages;
}
-}
\ No newline at end of file
+}
diff --git a/includes/Pagination/PageList.php b/includes/Pagination/PageList.php
index 8faf7b4..7f3e14a 100644
--- a/includes/Pagination/PageList.php
+++ b/includes/Pagination/PageList.php
@@ -94,4 +94,4 @@
is_numeric( $range ) && $range == $number ||
preg_match( '/^([0-9]*)to([0-9]*)$/', $range, $m ) && 
$m[1] <= $number && $number <= $m[2];
}
-}
\ No newline at end of file
+}
diff --git a/includes/Pagination/PageNotInPaginationException.php 
b/includes/Pagination/PageNotInPaginationException.php
index 9b4c8c1..2ad319c 100644
--- a/includes/Pagination/PageNotInPaginationException.php
+++ b/includes/Pagination/PageNotInPaginationException.php
@@ -10,4 +10,4 @@
  * An exception thrown if the page is not in the pagination
  */
 class PageNotInPaginationException extends InvalidArgumentException {
-}
\ No newline at end of file
+}
diff --git a/includes/Pagination/PageNumber.php 
b/includes/Pagination/PageNumber.php
index f9bba87..5d3faea 100644
--- a/includes/Pagination/PageNumber.php
+++ b/includes/Pagination/PageNumber.php
@@ -99,4 +99,4 @@
self::DISPLAY_HIGHROMAN
);
}
-}
\ No newline at end of file
+}
diff --git a/includes/Pagination/PagePagination.php 
b/includes/Pagination/PagePagination.php
index 9b6fcc9..15ff1e8 100644
--- a/includes/Pagination/PagePagination.php
+++ b/includes/Pagination/PagePagination.php
@@ -85,4 +85,4 @@
protected 

[MediaWiki-commits] [Gerrit] PHPCS: reenable Generic.WhiteSpace.DisallowSpaceIndent and m... - change (mediawiki...ProofreadPage)

2016-05-08 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: PHPCS: reenable Generic.WhiteSpace.DisallowSpaceIndent and make 
pass
..

PHPCS: reenable Generic.WhiteSpace.DisallowSpaceIndent and make pass

Also specify that only files with php extension must be checked.

Change-Id: I86da7871b61b23b45bbcec8cf84cd59c1469040c
---
M includes/page/PageContent.php
M maintenance/fixProofreadPagePagesContentModel.php
M phpcs.xml
M tests/includes/index/ProofreadIndexPageTest.php
4 files changed, 9 insertions(+), 11 deletions(-)


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

diff --git a/includes/page/PageContent.php b/includes/page/PageContent.php
index 3b1..c4e31fa 100644
--- a/includes/page/PageContent.php
+++ b/includes/page/PageContent.php
@@ -12,10 +12,10 @@
 use WikitextContent;
 
 /**
-  * @licence GNU GPL v2+
-  *
-  * Content of a Page: page
-  */
+ * @licence GNU GPL v2+
+ *
+ * Content of a Page: page
+ */
 class PageContent extends TextContent {
 
/**
diff --git a/maintenance/fixProofreadPagePagesContentModel.php 
b/maintenance/fixProofreadPagePagesContentModel.php
index f5aeeba..c823451 100644
--- a/maintenance/fixProofreadPagePagesContentModel.php
+++ b/maintenance/fixProofreadPagePagesContentModel.php
@@ -24,9 +24,9 @@
require_once $basePath . '/maintenance/Maintenance.php';
 }
 
- /**
-  * Set the content model type for Page: pages
-  */
+/**
+ * Set the content model type for Page: pages
+ */
 class FixProofreadPagePagesContentModel extends LoggedUpdateMaintenance {
 
public function __construct() {
diff --git a/phpcs.xml b/phpcs.xml
index d4141c6..05fa8de 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -31,9 +31,6 @@

0

-   
-   0
-   

0

@@ -58,6 +55,7 @@
0

.
+   
node_modules/
vendor/
 
diff --git a/tests/includes/index/ProofreadIndexPageTest.php 
b/tests/includes/index/ProofreadIndexPageTest.php
index 4a74640..3a6c1a9 100644
--- a/tests/includes/index/ProofreadIndexPageTest.php
+++ b/tests/includes/index/ProofreadIndexPageTest.php
@@ -172,7 +172,7 @@
$links = array(
array( Title::newFromText( 'Test/Chapter 1' ), 'Chapter 
1' ),
array( Title::newFromText( 'Azerty:Test/Chapter_2' ), 
'Chapter 2' )
-);
+   );
$this->assertEquals( $links, $page->getLinksToMainNamespace() );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86da7871b61b23b45bbcec8cf84cd59c1469040c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] PHPCS: reenable some MediaWiki.WhiteSpace rules and make pass - change (mediawiki...ProofreadPage)

2016-05-08 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: PHPCS: reenable some MediaWiki.WhiteSpace rules and make pass
..

PHPCS: reenable some MediaWiki.WhiteSpace rules and make pass

Change-Id: Ic1bdf35c1747ab4b54a311e308965934cefb0d18
---
M ApiQueryProofread.php
M SpecialPagesWithoutScans.php
M SpecialProofreadPages.php
M includes/Pagination/PageList.php
M includes/Pagination/PageNumber.php
M includes/Parser/PagesTagParser.php
M includes/index/ProofreadIndexEntry.php
M includes/index/oai/ProofreadIndexOaiRecord.php
M includes/index/oai/SpecialProofreadIndexOai.php
M includes/index/oai/SpecialProofreadIndexOaiSchema.php
M includes/page/PageContentHandler.php
M includes/page/ProofreadPageDbConnector.php
M includes/page/ProofreadPagePage.php
M maintenance/fixProofreadPagePagesContentModel.php
M phpcs.xml
M tests/includes/Pagination/PageNumberTest.php
M tests/includes/Pagination/PagePaginationTest.php
M tests/includes/index/ProofreadIndexPageTest.php
M tests/includes/page/PageContentHandlerTest.php
M tests/includes/page/PageContentTest.php
20 files changed, 44 insertions(+), 53 deletions(-)


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

diff --git a/ApiQueryProofread.php b/ApiQueryProofread.php
index 007ca3a..0120b7e 100644
--- a/ApiQueryProofread.php
+++ b/ApiQueryProofread.php
@@ -62,7 +62,7 @@
'cllimit' => 'max'
) );
 
-   $api = new ApiMain($params);
+   $api = new ApiMain( $params );
$api->execute();
if ( defined( 'ApiResult::META_CONTENT' ) ) {
$data = $api->getResult()->getResultData();
@@ -80,7 +80,7 @@
}
 
$result = $this->getResult();
-   foreach ( $pages as $pageid => $data) {
+   foreach ( $pages as $pageid => $data ) {
if ( !array_key_exists( 'categories', $data ) ) {
continue;
}
diff --git a/SpecialPagesWithoutScans.php b/SpecialPagesWithoutScans.php
index d47b756..b06658e 100644
--- a/SpecialPagesWithoutScans.php
+++ b/SpecialPagesWithoutScans.php
@@ -49,26 +49,26 @@
 
# If the text can be treated as a title, use it verbatim.
# Otherwise, pull the titles from the links table
-   $dp = Title::newFromText($dMsgText);
+   $dp = Title::newFromText( $dMsgText );
if ( $dp ) {
-   if ($dp->getNamespace() != NS_TEMPLATE) {
+   if ( $dp->getNamespace() != NS_TEMPLATE ) {
# FIXME we assume the disambiguation message is 
a template but
# the page can potentially be from another 
namespace :/
-   
wfDebug("Mediawiki:proofreadpage-disambiguationspage message does not refer to 
a template!\n");
+   wfDebug( 
"Mediawiki:proofreadpage-disambiguationspage message does not refer to a 
template!\n" );
}
$linkBatch->addObj( $dp );
} else {
# Get all the templates linked from the 
Mediawiki:Disambiguationspage
$disPageObj = Title::makeTitleSafe( NS_MEDIAWIKI, 
'disambiguationspage' );
$res = $dbr->select(
-   array('pagelinks', 'page'),
+   array( 'pagelinks', 'page' ),
'pl_title',
-   array('page_id = pl_from', 'pl_namespace' => 
NS_TEMPLATE,
-   'page_namespace' => 
$disPageObj->getNamespace(), 'page_title' => $disPageObj->getDBkey()),
+   array( 'page_id = pl_from', 'pl_namespace' => 
NS_TEMPLATE,
+   'page_namespace' => 
$disPageObj->getNamespace(), 'page_title' => $disPageObj->getDBkey() ),
__METHOD__ );
 
foreach ( $res as $row ) {
-   $linkBatch->addObj( Title::makeTitle( 
NS_TEMPLATE, $row->pl_title ));
+   $linkBatch->addObj( Title::makeTitle( 
NS_TEMPLATE, $row->pl_title ) );
}
}
return $linkBatch->constructSet( 'tl', $dbr );
diff --git a/SpecialProofreadPages.php b/SpecialProofreadPages.php
index afdaccf..ec279ad 100644
--- a/SpecialProofreadPages.php
+++ b/SpecialProofreadPages.php
@@ -51,11 +51,11 @@
$orderSelect->addOption( $this->msg( 
'proofreadpage_alphabeticalorder' )->text(), 'alpha' );
 
$output->addHTML(
-   Html::openElement( 'form', array( 'action' 

[MediaWiki-commits] [Gerrit] PHPCS: reenable MediaWiki.WhiteSpace.SpaceAfterControlStruct... - change (mediawiki...ProofreadPage)

2016-05-07 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: PHPCS: reenable MediaWiki.WhiteSpace.SpaceAfterControlStructure 
and make pass
..

PHPCS: reenable MediaWiki.WhiteSpace.SpaceAfterControlStructure and make pass

Change-Id: I67e7c4f2f810796ccca9e910f0736b49fdc4e852
---
M ProofreadPage.body.php
M SpecialPagesWithoutScans.php
M SpecialProofreadPages.php
M includes/Pagination/PaginationFactory.php
M includes/Parser/PagelistTagParser.php
M includes/Parser/PagesTagParser.php
M includes/index/EditProofreadIndexPage.php
M includes/index/ProofreadIndexDbConnector.php
M includes/index/ProofreadIndexEntry.php
M includes/index/ProofreadIndexPage.php
M includes/index/ProofreadIndexValue.php
M includes/index/oai/ProofreadIndexOaiRecord.php
M includes/index/oai/ProofreadIndexOaiSets.php
M includes/index/oai/SpecialProofreadIndexOai.php
M includes/page/PageContent.php
M includes/page/PageContentBuilder.php
M includes/page/PageContentHandler.php
M includes/page/ProofreadPageDbConnector.php
M includes/page/ProofreadPagePage.php
M phpcs.xml
M tests/includes/FileProviderMock.php
M tests/includes/ProofreadPageTestCase.php
22 files changed, 176 insertions(+), 179 deletions(-)


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

diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index 4af6b6b..88e1f9a 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -277,7 +277,7 @@
 * @return bool
 */
public static function onOutputPageParserOutput( $outputPage, 
$parserOutput ) {
-   if( isset( $parserOutput->is_toc ) ) {
+   if ( isset( $parserOutput->is_toc ) ) {
$outputPage->is_toc = $parserOutput->is_toc;
} else {
$outputPage->is_toc = false;
@@ -324,7 +324,7 @@
if ( !isset( $title->prpIndexPage ) ) {
ProofreadPage::loadIndex( $title );
}
-   if( $title->prpIndexPage === null ) {
+   if ( $title->prpIndexPage === null ) {
return true;
}
 
@@ -338,7 +338,7 @@
 */
$indexId = $title->prpIndexPage->getTitle()->getArticleID();
$x = ProofreadIndexDbConnector::getIndexDataFromIndexPageId( 
$indexId );
-   if( $x ) {
+   if ( $x ) {
$a = ProofreadIndexDbConnector::replaceIndexById( $x, 
$indexId, $article );
}
 
@@ -405,21 +405,21 @@
// $nt is used here on purpose, as we need to get the 
page id.
// There is no page under the old title or it is a 
redirect.
$article = new Article( $nt );
-   if( $article ) {
+   if ( $article ) {
ProofreadIndexDbConnector::removeIndexData( 
$article->getId() );
}
}
 
if ( $nt->inNamespace( self::getPageNamespaceId() ) ) {
self::loadIndex( $nt );
-   if( $nt->prpIndexPage !== null
+   if ( $nt->prpIndexPage !== null
&& ( !isset( $ot->prpIndexPage ) || ( 
$nt->prpIndexPage->getTitle()->equals( $ot->prpIndexPage->getTitle() ) ) ) ) {
self::updateIndexOfPage( $nt );
}
} elseif ( $nt->inNamespace( self::getIndexNamespaceId() ) ) {
// Update index data.
$article = new Article( $nt );
-   if( $article ) {
+   if ( $article ) {
self::updatePrIndex( $article );
}
}
@@ -454,19 +454,19 @@
$pagination = 
Context::getDefaultContext()->getPaginationFactory()->getPaginationForIndexPage(
ProofreadIndexPage::newFromTitle( $indexTitle )
);
-   foreach( $pagination as $page ) {
+   foreach ( $pagination as $page ) {
if ( $deletedPage === null || 
!$page->getTitle()->equals( $deletedPage ) ) {
array_push( $pages, 
$page->getTitle()->getDBKey() );
}
}
 
-   if( !count( $pages ) ) {
+   if ( !count( $pages ) ) {
return;
}
 
$total = 
ProofreadPageDbConnector::getNumberOfExistingPagesFromPageTitle( $pages );
 
-   if( $total === null ) {
+   if ( $total === null ) {
return;
}
 
@@ -495,24 +495,24 @@
 */
private static function prepareArticle( 

[MediaWiki-commits] [Gerrit] PHPCS: reenable some Squiz.WhiteSpace rules and make pass - change (mediawiki...ProofreadPage)

2016-05-07 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: PHPCS: reenable some Squiz.WhiteSpace rules and make pass
..

PHPCS: reenable some Squiz.WhiteSpace rules and make pass

Change-Id: I6efef009bddb5fb9871b9a1ed13be935ce60bf00
---
M ProofreadPage.body.php
M includes/Parser/PagesTagParser.php
M includes/index/ProofreadIndexValue.php
M maintenance/fixProofreadPagePagesContentModel.php
M phpcs.xml
M tests/includes/Pagination/PaginationFactoryTest.php
6 files changed, 7 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage 
refs/changes/11/287411/1

diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index 3a7499d..4af6b6b 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -864,7 +864,7 @@
global $wgContentHandlers;
 
// L10n
-   include_once( __DIR__ . '/ProofreadPage.namespaces.php' );
+   include_once ( __DIR__ . '/ProofreadPage.namespaces.php' );
 
// Content handler
define( 'CONTENT_MODEL_PROOFREAD_PAGE', 'proofread-page' );
diff --git a/includes/Parser/PagesTagParser.php 
b/includes/Parser/PagesTagParser.php
index ae532e4..6bc2da9 100644
--- a/includes/Parser/PagesTagParser.php
+++ b/includes/Parser/PagesTagParser.php
@@ -105,7 +105,7 @@
if( !$to ) {
$to = $count;
}
-   if( !is_numeric( $from ) || 
!is_numeric( $to )  || !is_numeric( $step ) ) {
+   if( !is_numeric( $from ) || 
!is_numeric( $to ) || !is_numeric( $step ) ) {
return $this->formatError( 
'proofreadpage_number_expected' );
}
 
@@ -301,7 +301,7 @@
$h_out .= "|$key=$val";
}
$h_out .= '}}';
-   $out = $h_out . $out ;
+   $out = $h_out . $out;
}
 
// wrap the output in a div, to prevent the parser from 
inserting paragraphs
diff --git a/includes/index/ProofreadIndexValue.php 
b/includes/index/ProofreadIndexValue.php
index 9e3a894..31ce437 100644
--- a/includes/index/ProofreadIndexValue.php
+++ b/includes/index/ProofreadIndexValue.php
@@ -285,7 +285,7 @@
public function getMainText() {
$val = $this->value->getBaseText();
$parts = explode( ':', $this->value->getBaseText() );
-if( count( $parts ) > 1 && $parts[0] == $this->value->getNsText() ) {
+   if( count( $parts ) > 1 && $parts[0] == 
$this->value->getNsText() ) {
unset( $parts[0] );
return implode( '/', $parts );
} else {
@@ -623,7 +623,7 @@
 * @param array $config
 */
public function __construct( $value, $config ) {
-   if( isset( $config['naan'] ) &&  $config['naan'] ) {
+   if( isset( $config['naan'] ) && $config['naan'] ) {
$this->naan = $config['naan'];
}
parent::__construct( $value, $config );
diff --git a/maintenance/fixProofreadPagePagesContentModel.php 
b/maintenance/fixProofreadPagePagesContentModel.php
index 0924542..e851669 100644
--- a/maintenance/fixProofreadPagePagesContentModel.php
+++ b/maintenance/fixProofreadPagePagesContentModel.php
@@ -72,4 +72,4 @@
 }
 
 $maintClass = 'FixProofreadPagePagesContentModel';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once ( RUN_MAINTENANCE_IF_MAIN );
diff --git a/phpcs.xml b/phpcs.xml
index 41625b0..e004759 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -66,25 +66,7 @@

0

-   
-   0
-   
-   
-   0
-   
-   
-   0
-   

-   0
-   
-   
-   0
-   
-   
-   0
-   
-   
0

.
diff --git a/tests/includes/Pagination/PaginationFactoryTest.php 
b/tests/includes/Pagination/PaginationFactoryTest.php
index da761d2..91eb918 100644
--- a/tests/includes/Pagination/PaginationFactoryTest.php
+++ b/tests/includes/Pagination/PaginationFactoryTest.php
@@ -42,4 +42,4 @@
);
$this->assertEquals( $pagination, 
$this->getContext()->getPaginationFactory()->getPaginationForIndexPage( $page ) 
);
}
-} 
\ No newline at end of file
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6efef009bddb5fb9871b9a1ed13be935ce60bf00
Gerrit-PatchSet: 1

[MediaWiki-commits] [Gerrit] Show label instead of URI for globes in coordinate diffs - change (mediawiki...Wikibase)

2016-05-07 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Show label instead of URI for globes in coordinate diffs
..

Show label instead of URI for globes in coordinate diffs

By using VocabularyUriFormatter in GlobeCoordinateDetailsFormatter as
suggested by Thiemo at https://phabricator.wikimedia.org/T110193#1637667

Bug: T110193
Change-Id: I86fe2c7abecfc4fbd750f8d08f8a4da056b7daae
---
M lib/includes/Formatters/GlobeCoordinateDetailsFormatter.php
M lib/includes/Formatters/WikibaseValueFormatterBuilders.php
2 files changed, 32 insertions(+), 3 deletions(-)


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

diff --git a/lib/includes/Formatters/GlobeCoordinateDetailsFormatter.php 
b/lib/includes/Formatters/GlobeCoordinateDetailsFormatter.php
index a00f4df..b0a9fe2 100644
--- a/lib/includes/Formatters/GlobeCoordinateDetailsFormatter.php
+++ b/lib/includes/Formatters/GlobeCoordinateDetailsFormatter.php
@@ -28,15 +28,26 @@
protected $coordinateFormatter;
 
/**
+* @var ValueFormatter|null
+*/
+   protected $vocabularyUriFormatter;
+
+   /**
+* @param ValueFormatter|null $vocabularyUriFormatter
 * @param FormatterOptions|null $options
 */
-   public function __construct( FormatterOptions $options = null ) {
+   public function __construct(
+   ValueFormatter $vocabularyUriFormatter = null,
+   FormatterOptions $options = null
+   ) {
parent::__construct( $options );
 
// TODO: What's a good default? Should this be locale 
dependant? Configurable?
$this->defaultOption( GeoCoordinateFormatter::OPT_FORMAT, 
GeoCoordinateFormatter::TYPE_DMS );
 
$this->coordinateFormatter = new GlobeCoordinateFormatter( 
$this->options );
+
+   $this->vocabularyUriFormatter = $vocabularyUriFormatter;
}
 
/**
@@ -72,7 +83,7 @@
$html .= $this->renderLabelValuePair( 'precision',
htmlspecialchars( $value->getPrecision() ) );
$html .= $this->renderLabelValuePair( 'globe',
-   htmlspecialchars( $value->getGlobe() ) );
+   $this->formatGlobe( $value->getGlobe() ) );
 
$html .= Html::closeElement( 'table' );
 
@@ -80,6 +91,21 @@
}
 
/**
+* @param string $globe URI
+*
+* @return string HTML
+*/
+   private function formatGlobe( $globe ) {
+   $formattedGlobe = $this->vocabularyUriFormatter->format( $globe 
);
+
+   if ( $formattedGlobe === null || $formattedGlobe === $globe ) {
+   return htmlspecialchars( $globe );
+   }
+
+   return Html::element( 'a', array( 'href' => $globe ), 
$formattedGlobe );
+   }
+
+   /**
 * @param string $fieldName
 * @param string $valueHtml HTML
 *
diff --git a/lib/includes/Formatters/WikibaseValueFormatterBuilders.php 
b/lib/includes/Formatters/WikibaseValueFormatterBuilders.php
index 45deded..400efa5 100644
--- a/lib/includes/Formatters/WikibaseValueFormatterBuilders.php
+++ b/lib/includes/Formatters/WikibaseValueFormatterBuilders.php
@@ -291,7 +291,10 @@
 */
public function newGlobeCoordinateFormatter( $format, FormatterOptions 
$options ) {
if ( $format === SnakFormatter::FORMAT_HTML_DIFF ) {
-   return new GlobeCoordinateDetailsFormatter( $options );
+   return new GlobeCoordinateDetailsFormatter(
+   $this->getVocabularyUriFormatter( $options ),
+   $options
+   );
} else {
$options->setOption( 
GeoCoordinateFormatter::OPT_FORMAT, GeoCoordinateFormatter::TYPE_DMS );
$options->setOption( 
GeoCoordinateFormatter::OPT_SPACING_LEVEL, array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86fe2c7abecfc4fbd750f8d08f8a4da056b7daae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Add mediawiki/mediawiki-codesniffer - change (mediawiki...ProofreadPage)

2016-05-06 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Add mediawiki/mediawiki-codesniffer
..

Add mediawiki/mediawiki-codesniffer

Failing rules are disabled for now.

Change-Id: I7807c31e0b7c579da98d4032ebfcb60fd9e314cb
---
M composer.json
A phpcs.xml
2 files changed, 97 insertions(+), 2 deletions(-)


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

diff --git a/composer.json b/composer.json
index aa87a46..e083441 100644
--- a/composer.json
+++ b/composer.json
@@ -8,11 +8,13 @@
"composer/installers": "*"
},
"require-dev": {
-   "jakub-onderka/php-parallel-lint": "0.9.2"
+   "jakub-onderka/php-parallel-lint": "0.9.2",
+   "mediawiki/mediawiki-codesniffer": "0.6.0"
},
"scripts": {
"test": [
-   "parallel-lint . --exclude node_modules --exclude 
vendor"
+   "parallel-lint . --exclude node_modules --exclude 
vendor",
+   "phpcs"
]
}
 }
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 000..059913c
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,93 @@
+
+
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   
+   
+   
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   .
+   node_modules/
+   vendor/
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7807c31e0b7c579da98d4032ebfcb60fd9e314cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] AutoCommentFormatter: add language name with LanguageNameLookup - change (mediawiki...Wikibase)

2016-05-06 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: AutoCommentFormatter: add language name with LanguageNameLookup
..

AutoCommentFormatter: add language name with LanguageNameLookup

As $3 parameter for actions starting with "wbsetlabel",
"wbsetdescription" or "wbsetaliases".

Bug: T85560
Change-Id: Ie46e7d5c51c38295d0acc9b8be2f587ebaf28543
---
M client/WikibaseClient.hooks.php
M lib/i18n/en.json
M lib/includes/Formatters/AutoCommentFormatter.php
M lib/tests/phpunit/Formatters/AutoCommentFormatterTest.php
M repo/Wikibase.hooks.php
5 files changed, 74 insertions(+), 16 deletions(-)


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

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index bd2faa2..563966a 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -28,6 +28,7 @@
 use Wikibase\Client\WikibaseClient;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\Lib\AutoCommentFormatter;
+use Wikibase\Lib\LanguageNameLookup;
 
 /**
  * File defining the hook handlers for the Wikibase Client extension.
@@ -176,7 +177,11 @@
 
StubObject::unstub( $wgContLang );
 
-   $formatter = new AutoCommentFormatter( $wgContLang, array( 
'wikibase-entity' ) );
+   $formatter = new AutoCommentFormatter(
+   $wgContLang,
+   array( 'wikibase-entity' ),
+   new LanguageNameLookup()
+   );
$formattedComment = $formatter->formatAutoComment( $auto );
 
if ( is_string( $formattedComment ) ) {
diff --git a/lib/i18n/en.json b/lib/i18n/en.json
index c6c79b0..111e59e 100644
--- a/lib/i18n/en.json
+++ b/lib/i18n/en.json
@@ -100,17 +100,17 @@
"wikibase-entity-summary-wbsetreference": "Set a reference",
"wikibase-entity-summary-wbsetreference-add": "Added reference to 
claim",
"wikibase-entity-summary-wbsetreference-set": "Changed reference of 
claim",
-   "wikibase-entity-summary-wbsetlabel-add": "Added [$2] label",
-   "wikibase-entity-summary-wbsetlabel-set": "Changed [$2] label",
-   "wikibase-entity-summary-wbsetlabel-remove": "Removed [$2] label",
-   "wikibase-entity-summary-wbsetdescription-add": "Added [$2] 
description",
-   "wikibase-entity-summary-wbsetdescription-set": "Changed [$2] 
description",
-   "wikibase-entity-summary-wbsetdescription-remove": "Removed [$2] 
description",
-   "wikibase-entity-summary-wbsetaliases-set": "Setting [$2] 
{{PLURAL:$1|alias|aliases}}",
-   "wikibase-entity-summary-wbsetaliases-add-remove": "Added and removed 
[$2] {{PLURAL:$1|alias|aliases}}",
-   "wikibase-entity-summary-wbsetaliases-add": "Added [$2] 
{{PLURAL:$1|alias|aliases}}",
-   "wikibase-entity-summary-wbsetaliases-remove": "Removed [$2] 
{{PLURAL:$1|alias|aliases}}",
-   "wikibase-entity-summary-wbsetlabeldescriptionaliases": "Changed [$2] 
label, description and aliases",
+   "wikibase-entity-summary-wbsetlabel-add": "Added $3 label",
+   "wikibase-entity-summary-wbsetlabel-set": "Changed $3 label",
+   "wikibase-entity-summary-wbsetlabel-remove": "Removed $3 label",
+   "wikibase-entity-summary-wbsetdescription-add": "Added $3 description",
+   "wikibase-entity-summary-wbsetdescription-set": "Changed $3 
description",
+   "wikibase-entity-summary-wbsetdescription-remove": "Removed $3 
description",
+   "wikibase-entity-summary-wbsetaliases-set": "Setting $3 
{{PLURAL:$1|alias|aliases}}",
+   "wikibase-entity-summary-wbsetaliases-add-remove": "Added and removed 
$3 {{PLURAL:$1|alias|aliases}}",
+   "wikibase-entity-summary-wbsetaliases-add": "Added $3 
{{PLURAL:$1|alias|aliases}}",
+   "wikibase-entity-summary-wbsetaliases-remove": "Removed $3 
{{PLURAL:$1|alias|aliases}}",
+   "wikibase-entity-summary-wbsetlabeldescriptionaliases": "Changed $3 
label, description and aliases",
"wikibase-entity-summary-wbsetsitelink-add": "Added link to [$2]",
"wikibase-entity-summary-wbsetsitelink-add-both": "Added link with 
badges to [$2]",
"wikibase-entity-summary-wbsetsitelink-set": "Changed link to [$2]",
diff --git a/lib/includes/Formatters/AutoCommentFormatter.php 
b/lib/includes/Formatters/AutoCommentFormatter.php
index 74e8d92..9bfcf11 100644
--- a/lib/includes/Formatters/AutoCommentFormatter.php
+++ b/lib/includes/Formatters/AutoCommentFormatter.php
@@ -37,14 +37,25 @@
private $messages = array();
 
/**
+* @var LanguageNameLookup
+*/
+   private $languageNameLookup;
+
+   /**
 * @param Language $language
 * @param string[] $messagePrefixes Prefixes to try when constructing 
the message key from
 *the name given in the autocomment block. Typically 

[MediaWiki-commits] [Gerrit] Standardize Doxygen @param tags - change (mediawiki...ProofreadPage)

2016-05-06 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Standardize Doxygen @param tags
..

Standardize Doxygen @param tags

Use "@param datatype $paramname description" format.

Change-Id: I20a337f060130bb55485e809b806e65f9ee4
---
M ProofreadPage.body.php
M SpecialPagesWithoutScans.php
M includes/DiffFormatterUtils.php
M includes/FileProvider.php
M includes/Parser/PagesTagParser.php
M includes/ProofreadPageInit.php
M includes/index/EditProofreadIndexPage.php
M includes/index/ProofreadIndexEntry.php
M includes/index/ProofreadIndexPage.php
M includes/index/ProofreadIndexValue.php
M includes/index/oai/ProofreadIndexOaiRecord.php
M includes/index/oai/SpecialProofreadIndexOai.php
M includes/page/PageContent.php
M includes/page/PageDifferenceEngine.php
M includes/page/PageLevel.php
M includes/page/ProofreadPageDbConnector.php
M includes/page/ProofreadPagePage.php
M tests/includes/index/ProofreadIndexPageTest.php
M tests/includes/page/PageContentTest.php
M tests/includes/page/ProofreadPagePageTest.php
20 files changed, 113 insertions(+), 113 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage 
refs/changes/40/287240/1

diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index bdc7f87..3a7499d 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -70,7 +70,7 @@
}
 
/**
-* @param $queryPages array
+* @param array $queryPages
 * @return bool
 */
public static function onwgQueryPages( &$queryPages ) {
@@ -127,7 +127,7 @@
 
/**
 * Query the database to find if the current page is referred in an 
Index page.
-* @param $title Title
+* @param Title $title
 */
public static function loadIndex( $title ) {
$title->prpIndexPage = null;
@@ -161,7 +161,7 @@
 
/**
 * Append javascript variables and code to the page.
-* @param $out OutputPage
+* @param OutputPage $out
 * @return bool
 */
public static function onBeforePageDisplay( OutputPage $out ) {
@@ -202,8 +202,8 @@
 
/**
 * Return the quality colour codes to pages linked from an index page
-* @param $page_ids array
-* @param $colours array
+* @param array $page_ids
+* @param array $colours
 */
private static function getLinkColours( $page_ids, &$colours ) {
global $wgTitle;
@@ -254,8 +254,8 @@
}
 
/**
-* @param $imgpage ImagePage
-* @param $out OutputPage
+* @param ImagePage $imgpage
+* @param OutputPage $out
 * @return bool
 */
public static function onImageOpenShowImageInlineBefore( &$imgpage, 
&$out ) {
@@ -272,8 +272,8 @@
 
/**
 * Set is_toc flag (true if page is a table of contents)
-* @param $outputPage OutputPage
-* @param $parserOutput ParserOutput
+* @param OutputPage $outputPage
+* @param ParserOutput $parserOutput
 * @return bool
 */
public static function onOutputPageParserOutput( $outputPage, 
$parserOutput ) {
@@ -287,8 +287,8 @@
 
/**
 * Updates index data for an index referencing the specified page.
-* @param $title Title page title object
-* @param $deleted boolean indicates whether the page was deleted
+* @param Title $title page title object
+* @param boolean $deleted indicates whether the page was deleted
 */
private static function updateIndexOfPage( $title, $deleted = false ) {
self::loadIndex( $title );
@@ -303,7 +303,7 @@
}
 
/**
-* @param $article WikiPage
+* @param WikiPage $article
 * @return bool
 */
public static function onArticleSaveComplete( WikiPage &$article ) {
diff --git a/SpecialPagesWithoutScans.php b/SpecialPagesWithoutScans.php
index 7f713c3..043bfcd 100644
--- a/SpecialPagesWithoutScans.php
+++ b/SpecialPagesWithoutScans.php
@@ -39,7 +39,7 @@
/**
 * Return a clause with the list of disambiguation templates.
 * This function was copied verbatim from 
specials/SpecialDisambiguations.php
-* @param $dbr DatabaseBase
+* @param DatabaseBase $dbr
 * @return mixed
 */
function disambiguation_templates( $dbr ) {
diff --git a/includes/DiffFormatterUtils.php b/includes/DiffFormatterUtils.php
index 9268936..4b7bf69 100644
--- a/includes/DiffFormatterUtils.php
+++ b/includes/DiffFormatterUtils.php
@@ -14,7 +14,7 @@
/**
 * Create an header in the two columns
 *
-* @param $text string the header HTML
+* @param string $text the header HTML
 * @return string
 */
public function createHeader( $text ) {
@@ -27,7 

[MediaWiki-commits] [Gerrit] Do not show useless form at Special:ChangeContentModel - change (mediawiki/core)

2016-05-04 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Do not show useless form at Special:ChangeContentModel
..

Do not show useless form at Special:ChangeContentModel

If the choosen title cannot be converted to any of the available
models, show an error page instead of an empty and confusing dropdown
field asking for the new content model.

Change-Id: Idc7372a8870f98aa8148592385f3a837f16886f0
---
M includes/specials/SpecialChangeContentModel.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/81/286881/1

diff --git a/includes/specials/SpecialChangeContentModel.php 
b/includes/specials/SpecialChangeContentModel.php
index ee9f665..c7a650c 100644
--- a/includes/specials/SpecialChangeContentModel.php
+++ b/includes/specials/SpecialChangeContentModel.php
@@ -84,12 +84,20 @@
],
];
if ( $this->title ) {
+   $options = $this->getOptionsForTitle( $this->title );
+   if ( empty( $options ) ) {
+   throw new ErrorPageError(
+   'changecontentmodel-emptymodels-title',
+   'changecontentmodel-emptymodels-text',
+   $this->title->getPrefixedText()
+   );
+   }
$fields['pagetitle']['readonly'] = true;
$fields += [
'model' => [
'type' => 'select',
'name' => 'model',
-   'options' => $this->getOptionsForTitle( 
$this->title ),
+   'options' => $options,
'label-message' => 
'changecontentmodel-model-label'
],
'reason' => [
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index aacf623..0936079 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2133,6 +2133,8 @@
"changecontentmodel-success-text": "The content type of [[:$1]] has 
been changed.",
"changecontentmodel-cannot-convert": "The content on [[:$1]] cannot be 
converted to a type of $2.",
"changecontentmodel-nodirectediting": "The $1 content model does not 
support direct editing",
+   "changecontentmodel-emptymodels-title": "No content models available",
+   "changecontentmodel-emptymodels-text": "The content on [[:$1]] cannot 
be converted to any type.",
"log-name-contentmodel": "Content model change log",
"log-description-contentmodel": "Events related to the content models 
of a page",
"logentry-contentmodel-new": "$1 {{GENDER:$2|created}} the page $3 
using a non-default content model \"$5\"",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index ed5c2b4..413b333 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -2311,6 +2311,8 @@
"changecontentmodel-success-text": "Message telling user that their 
change has been successfully done.\n* $1 - Target page title",
"changecontentmodel-cannot-convert": "Error message shown if the 
content model cannot be changed to the specified type. $1 is the page title, $2 
is the localized content model name.",
"changecontentmodel-nodirectediting": "Error message shown if the 
content model does not allow for direct editing. $1 is the localized name of 
the content model.",
+   "changecontentmodel-emptymodels-title": "Title of the error page shown 
if the content model cannot be changed to any of the available types.",
+   "changecontentmodel-emptymodels-text": "Text of the error page shown if 
the content model cannot be changed to any of the available types. $1 is the 
page title.",
"log-name-contentmodel": "{{doc-logpage}}\n\nTitle of 
[[Special:Log/contentmodel]].",
"log-description-contentmodel": "Text in [[Special:Log/contentmodel]].",
"logentry-contentmodel-new": "{{Logentry}}\n$4 is not used.\n$5 is the 
new content model.",

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

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

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


[MediaWiki-commits] [Gerrit] Fix and standardize Doxygen tags - change (mediawiki/core)

2016-04-30 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Fix and standardize Doxygen tags
..

Fix and standardize Doxygen tags

* Use "@param datatype $paramname description" format

* String → string, Integer → int etc.

* @return $string → @return string

Change-Id: I860d222382cb4c5699d313b0600bd22503c8c385
---
M includes/EditPage.php
M includes/api/ApiQueryImageInfo.php
M includes/compat/normal/UtfNormalUtil.php
M includes/libs/CSSMin.php
M includes/media/GIF.php
M includes/media/PNG.php
M includes/media/TransformationalImageHandler.php
M includes/password/PasswordPolicyChecks.php
M includes/resourceloader/ResourceLoaderSkinModule.php
M includes/search/SearchEngine.php
M includes/specialpage/QueryPage.php
M includes/specials/SpecialMediaStatistics.php
M tests/phpunit/includes/MergeHistoryTest.php
M tests/phpunit/includes/media/GIFTest.php
M tests/phpunit/includes/media/MediaHandlerTest.php
M tests/phpunit/includes/media/PNGTest.php
16 files changed, 53 insertions(+), 53 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/71/286271/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index 3522531..8f6b202 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -3777,7 +3777,7 @@
 * Shows a bulletin board style toolbar for common editing functions.
 * It can be disabled in the user preferences.
 *
-* @param $title Title object for the page being edited (optional)
+* @param Title $title Title object for the page being edited (optional)
 * @return string
 */
static function getEditToolbar( $title = null ) {
diff --git a/includes/api/ApiQueryImageInfo.php 
b/includes/api/ApiQueryImageInfo.php
index 13e6340..d1fcfa3 100644
--- a/includes/api/ApiQueryImageInfo.php
+++ b/includes/api/ApiQueryImageInfo.php
@@ -325,8 +325,8 @@
 * allows us to catch certain error conditions early (such as missing
 * required parameter).
 *
-* @param $image File
-* @param $finalParams array List of parameters to transform image with
+* @param File $image
+* @param array $finalParams List of parameters to transform image with
 */
protected function checkParameterNormalise( $image, $finalParams ) {
$h = $image->getHandler();
diff --git a/includes/compat/normal/UtfNormalUtil.php 
b/includes/compat/normal/UtfNormalUtil.php
index 0bc8d0f..8791e4c 100644
--- a/includes/compat/normal/UtfNormalUtil.php
+++ b/includes/compat/normal/UtfNormalUtil.php
@@ -30,8 +30,8 @@
 /**
  * Return UTF-8 sequence for a given Unicode code point.
  *
- * @param $codepoint Integer:
- * @return String
+ * @param int $codepoint
+ * @return string
  * @throws InvalidArgumentException if fed out of range data.
  * @public
  * @deprecated since 1.25, use UtfNormal\Utils directly
@@ -45,8 +45,8 @@
  * Unicode code points and return a UTF-8 string composed of those
  * characters. Used by UTF-8 data generation and testing routines.
  *
- * @param $sequence String
- * @return String
+ * @param string $sequence
+ * @return string
  * @throws InvalidArgumentException if fed out of range data.
  * @private
  * @deprecated since 1.25, use UtfNormal\Utils directly
@@ -77,8 +77,8 @@
  * Determine the Unicode codepoint of a single-character UTF-8 sequence.
  * Does not check for invalid input data.
  *
- * @param $char String
- * @return Integer
+ * @param string $char
+ * @return int
  * @public
  * @deprecated since 1.25, use UtfNormal\Utils directly
  */
diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php
index 2f2faed..6e40f4c 100644
--- a/includes/libs/CSSMin.php
+++ b/includes/libs/CSSMin.php
@@ -172,7 +172,7 @@
}
 
/**
-* @param $file string
+* @param string $file
 * @return bool|string
 */
public static function getMimeType( $file ) {
diff --git a/includes/media/GIF.php b/includes/media/GIF.php
index 8ec7298..5f23855 100644
--- a/includes/media/GIF.php
+++ b/includes/media/GIF.php
@@ -193,7 +193,7 @@
 *
 * Shown in the =imageinfo=size api query.
 *
-* @param $file File
+* @param File $file
 * @return float The duration of the file.
 */
public function getLength( $file ) {
diff --git a/includes/media/PNG.php b/includes/media/PNG.php
index f9af101..8a3e001 100644
--- a/includes/media/PNG.php
+++ b/includes/media/PNG.php
@@ -180,7 +180,7 @@
 *
 * Shown in the =imageinfo=size api query.
 *
-* @param $file File
+* @param File $file
 * @return float The duration of the file.
 */
public function getLength( $file ) {
diff --git a/includes/media/TransformationalImageHandler.php 
b/includes/media/TransformationalImageHandler.php
index f1f2161..3287fac 100644

[MediaWiki-commits] [Gerrit] Standardize Doxygen @param tags - change (mediawiki...Wikibase)

2016-04-30 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Standardize Doxygen @param tags
..

Standardize Doxygen @param tags

Use "@param datatype $paramname description" format.

Change-Id: If52c7f971575584028f5192a1fa87b0fda434ff0
---
M client/WikibaseClient.hooks.php
M lib/includes/LanguageWithConversion.php
M repo/Wikibase.hooks.php
M repo/includes/Actions/EditEntityAction.php
M repo/includes/Api/ApiErrorReporter.php
M repo/includes/Api/ModifyEntity.php
M repo/includes/Api/ResultBuilder.php
M repo/includes/Content/EntityHandler.php
M repo/includes/Diff/EntityContentDiffView.php
M repo/includes/Specials/SpecialSetSiteLink.php
M repo/tests/phpunit/includes/Api/EntityTestHelper.php
M repo/tests/phpunit/includes/Api/IndependentWikibaseApiTestCase.php
M view/src/EntityTermsView.php
M view/src/Template/TemplateFactory.php
14 files changed, 30 insertions(+), 30 deletions(-)


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

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 2705020..bd2faa2 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -347,7 +347,7 @@
/**
 * Register the parser functions.
 *
-* @param $parser Parser
+* @param Parser $parser
 *
 * @return bool
 */
diff --git a/lib/includes/LanguageWithConversion.php 
b/lib/includes/LanguageWithConversion.php
index 6f66ed4..1c59a4f 100644
--- a/lib/includes/LanguageWithConversion.php
+++ b/lib/includes/LanguageWithConversion.php
@@ -240,7 +240,7 @@
 *
 * Does nothing if this is not a converted language.
 *
-* @param $text String
+* @param string $text
 */
private function prepareForTranslate( $text ) {
if ( $this->parentLanguage ) {
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index 25ade02..0788182 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -303,7 +303,7 @@
 *
 * @todo: find a better way to do this!
 *
-* @param $recentChange RecentChange
+* @param RecentChange $recentChange
 * @return bool
 */
public static function onRecentChangeSave( RecentChange $recentChange ) 
{
diff --git a/repo/includes/Actions/EditEntityAction.php 
b/repo/includes/Actions/EditEntityAction.php
index 75a3b8c..ddf01da 100644
--- a/repo/includes/Actions/EditEntityAction.php
+++ b/repo/includes/Actions/EditEntityAction.php
@@ -434,8 +434,8 @@
/**
 * Generate standard summary input and label (wgSummary), compatible to 
EditPage.
 *
-* @param $summary string The value of the summary input
-* @param $labelText string The html to place inside the label
+* @param string $summary The value of the summary input
+* @param string $labelText The html to place inside the label
 *
 * @return array An array in the format array( $label, $input )
 */
diff --git a/repo/includes/Api/ApiErrorReporter.php 
b/repo/includes/Api/ApiErrorReporter.php
index 11f4ce3..8db020d 100644
--- a/repo/includes/Api/ApiErrorReporter.php
+++ b/repo/includes/Api/ApiErrorReporter.php
@@ -340,7 +340,7 @@
 * This provides support for message lists coming from 
Status::getErrorsByType() as well as
 * Title::getUserPermissionsErrors() etc.
 *
-* @param $messageSpecs array a list of errors, as returned by 
Status::getErrorsByType()
+* @param array $messageSpecs a list of errors, as returned by 
Status::getErrorsByType()
 *or Title::getUserPermissionsErrors()
 *
 * @return array a result structure containing the messages from 
$errors as well as what
@@ -383,7 +383,7 @@
 *
 * @see convertToMessage()
 *
-* @param $messageSpecs array a list of errors, as returned by 
Status::getErrorsByType()
+* @param array $messageSpecs a list of errors, as returned by 
Status::getErrorsByType()
 *or Title::getUserPermissionsErrors().
 *
 * @return array a result structure containing the messages from 
$errors as well as what
diff --git a/repo/includes/Api/ModifyEntity.php 
b/repo/includes/Api/ModifyEntity.php
index 376fd40..f93d709 100644
--- a/repo/includes/Api/ModifyEntity.php
+++ b/repo/includes/Api/ModifyEntity.php
@@ -464,8 +464,8 @@
/**
 * Check the rights for the user accessing the module.
 *
-* @param $entity EntityDocument the entity to check
-* @param $user User doing the action
+* @param EntityDocument $entity the entity to check
+* @param User $user User doing the action
 *
 * @return Status the check's result
 */
diff --git 

[MediaWiki-commits] [Gerrit] [BREAKING] Allow HTML in DiffFormatterUtils::createHeader() - change (mediawiki...ProofreadPage)

2016-04-30 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: [BREAKING] Allow HTML in DiffFormatterUtils::createHeader()
..

[BREAKING] Allow HTML in DiffFormatterUtils::createHeader()

Follow-up to commit 98a502c52414636c3928194cb0023a54e2514795

Change-Id: I9190f67b846ab6fd698e4b5c10c36907ee72e0ad
---
M includes/DiffFormatterUtils.php
M includes/page/PageDifferenceEngine.php
2 files changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/includes/DiffFormatterUtils.php b/includes/DiffFormatterUtils.php
index 3aa4a23..9268936 100644
--- a/includes/DiffFormatterUtils.php
+++ b/includes/DiffFormatterUtils.php
@@ -14,13 +14,13 @@
/**
 * Create an header in the two columns
 *
-* @param $text string the header text
+* @param $text string the header HTML
 * @return string
 */
public function createHeader( $text ) {
return Html::openElement( 'tr' ) .
-   Html::element( 'td', array( 'colspan' => '2', 'class' 
=> 'diff-lineno' ), $text ) .
-   Html::element( 'td', array( 'colspan' => '2', 'class' 
=> 'diff-lineno' ), $text ) .
+   Html::rawElement( 'td', array( 'colspan' => '2', 
'class' => 'diff-lineno' ), $text ) .
+   Html::rawElement( 'td', array( 'colspan' => '2', 
'class' => 'diff-lineno' ), $text ) .
Html::closeElement( 'tr' );
}
 
diff --git a/includes/page/PageDifferenceEngine.php 
b/includes/page/PageDifferenceEngine.php
index 26cd4ab..1553c76 100644
--- a/includes/page/PageDifferenceEngine.php
+++ b/includes/page/PageDifferenceEngine.php
@@ -68,6 +68,6 @@
return '';
}
 
-   return $this->diffFormatterUtils->createHeader( $this->msg( 
$headerMsg )->text() ) . $diff;
+   return $this->diffFormatterUtils->createHeader( $this->msg( 
$headerMsg )->escaped() ) . $diff;
}
 }
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9190f67b846ab6fd698e4b5c10c36907ee72e0ad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Link to consumer pages in log entries - change (mediawiki...OAuth)

2016-04-27 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Link to consumer pages in log entries
..

Link to consumer pages in log entries

The new MWOAuthLogFormatter class adds a $5 parameter to messages
like "logentry-mwoauthconsumer-*" which is a link to the relevant
subpage of Special:OAuthListConsumers/view.

English messages have been changed to use $5 instead of $4.

Change-Id: Ia787e0bbf5faaffb553901a6032cc2a263d7431e
---
M OAuth.setup.php
A frontend/MWOAuthLogFormatter.php
M frontend/MWOAuthUI.setup.php
M i18n/en.json
4 files changed, 67 insertions(+), 8 deletions(-)


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

diff --git a/OAuth.setup.php b/OAuth.setup.php
index 2443c32..645562d 100644
--- a/OAuth.setup.php
+++ b/OAuth.setup.php
@@ -38,6 +38,9 @@
$classes['MediaWiki\Extensions\OAuth\MWOAuthUIHooks'] = 
"$frontendDir/MWOAuthUI.hooks.php";
$classes['MediaWiki\Extensions\OAuth\MWOAuthHooks'] = 
"$backendDir/MWOAuth.hooks.php";
 
+   # Log formatter
+   $classes['MediaWiki\Extensions\OAuth\MWOAuthLogFormatter'] = 
"$frontendDir/MWOAuthLogFormatter.php";
+
# Special pages and pagers
$classes['MediaWiki\Extensions\OAuth\SpecialMWOAuth'] = 
"$specialsDir/SpecialMWOAuth.php";

$classes['MediaWiki\Extensions\OAuth\SpecialMWOAuthConsumerRegistration'] =
diff --git a/frontend/MWOAuthLogFormatter.php b/frontend/MWOAuthLogFormatter.php
new file mode 100644
index 000..71cb593
--- /dev/null
+++ b/frontend/MWOAuthLogFormatter.php
@@ -0,0 +1,56 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @license GPL-2.0+
+ */
+
+namespace MediaWiki\Extensions\OAuth;
+
+use Linker;
+use LogFormatter;
+use Message;
+use SpecialPage;
+
+/**
+ * Class for formatting MWOAuth logs.
+ */
+class MWOAuthLogFormatter extends LogFormatter {
+
+   public function getMessageParameters() {
+   $params = parent::getMessageParameters();
+   if ( isset( $params[3] ) ) {
+   // Messages:
+   // logentry-mwoauthconsumer-propose
+   // logentry-mwoauthconsumer-update
+   // logentry-mwoauthconsumer-approve
+   // logentry-mwoauthconsumer-reject
+   // logentry-mwoauthconsumer-disable
+   // logentry-mwoauthconsumer-reenable
+   // logentry-mwoauthconsumer-create-owner-only
+   $target = Linker::linkKnown(
+   SpecialPage::getTitleFor( 'OAuthListConsumers', 
"view/{$params[3]}" ),
+   htmlspecialchars( $params[3] )
+   );
+   $params[4] = Message::rawParam( $target );
+   }
+   return $params;
+   }
+
+}
diff --git a/frontend/MWOAuthUI.setup.php b/frontend/MWOAuthUI.setup.php
index cf5a414..2d5d824 100644
--- a/frontend/MWOAuthUI.setup.php
+++ b/frontend/MWOAuthUI.setup.php
@@ -58,7 +58,7 @@
$wgLogTypes[] = 'mwoauthconsumer';
$wgLogNames['mwoauthconsumer'] = 
'mwoauthconsumer-consumer-logpage';
$wgLogHeaders['mwoauthconsumer'] = 
'mwoauthconsumer-consumer-logpagetext';
-   $wgLogActionsHandlers['mwoauthconsumer/*'] = 
'LogFormatter';
+   $wgLogActionsHandlers['mwoauthconsumer/*'] = 
'MediaWiki\Extensions\OAuth\MWOAuthLogFormatter';
}
}
 }
diff --git a/i18n/en.json b/i18n/en.json
index 28856b1..0b21571 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -176,13 +176,13 @@
"mwoauthmanagemygrants-success-renounce": "The access token for this 
consumer has been deleted.",
"mwoauthmanagemygrants-basic-tooltip": "Why can't I update this grant? 
This grant gives your connected application basic permissions which it requires 
to function properly. If you don't want this connected application to have 
these rights, you should revoke the application's access.",
"mwoauthmanagemygrants-authonly-tooltip": "Why can't I update this 
grant? If you don't want this connected application to have this right, you 
should revoke the application's access.",
-   "logentry-mwoauthconsumer-propose": "$1 {{GENDER:$2|proposed}} an OAuth 
consumer (consumer key $4)",
-   "logentry-mwoauthconsumer-update": "$1 {{GENDER:$2|updated}} an OAuth 
consumer (consumer key $4)",
-   "logentry-mwoauthconsumer-approve": "$1 {{GENDER:$2|approved}} an OAuth 
consumer by $3 (consumer key $4)",
-   "logentry-mwoauthconsumer-reject": "$1 {{GENDER:$2|rejected}} an OAuth 
consumer by $3 (consumer key $4)",
-   "logentry-mwoauthconsumer-disable": "$1 {{GENDER:$2|disabled}} an OAuth 
consumer by $3 (consumer 

[MediaWiki-commits] [Gerrit] Parse 'proofreadpage_page_status' message in PageDifferenceE... - change (mediawiki...ProofreadPage)

2016-04-25 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Parse 'proofreadpage_page_status' message in 
PageDifferenceEngine
..

Parse 'proofreadpage_page_status' message in PageDifferenceEngine

For consistency with EditPagePage

Change-Id: Ia4ea9e92b68fde6d37b0e5a2412b4e356338040a
---
M includes/page/PageDifferenceEngine.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/page/PageDifferenceEngine.php 
b/includes/page/PageDifferenceEngine.php
index c7062df..26cd4ab 100644
--- a/includes/page/PageDifferenceEngine.php
+++ b/includes/page/PageDifferenceEngine.php
@@ -51,7 +51,7 @@
return '';
}
 
-   return $this->diffFormatterUtils->createHeader( $this->msg( 
'proofreadpage_page_status' )->text() ) . Html::openElement( 'tr' ) . 
$this->diffFormatterUtils->createDeletedLine( $this->msg( 
'proofreadpage_quality' . $old->getLevel() . '_category' )->plain(), 
'diff-deletedline', '-' ) . $this->diffFormatterUtils->createAddedLine( 
$this->msg( 'proofreadpage_quality' . $new->getLevel() . '_category' 
)->plain(), 'diff-addedline', '+' ) . Html::closeElement( 'tr' );
+   return $this->diffFormatterUtils->createHeader( $this->msg( 
'proofreadpage_page_status' )->parse() ) . Html::openElement( 'tr' ) . 
$this->diffFormatterUtils->createDeletedLine( $this->msg( 
'proofreadpage_quality' . $old->getLevel() . '_category' )->plain(), 
'diff-deletedline', '-' ) . $this->diffFormatterUtils->createAddedLine( 
$this->msg( 'proofreadpage_quality' . $new->getLevel() . '_category' 
)->plain(), 'diff-addedline', '+' ) . Html::closeElement( 'tr' );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4ea9e92b68fde6d37b0e5a2412b4e356338040a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Fix typo in README.md, PhpSesssionSerializer → PhpSessionSer... - change (php-session-serializer)

2016-04-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Fix typo in README.md, PhpSesssionSerializer → 
PhpSessionSerializer
..

Fix typo in README.md, PhpSesssionSerializer → PhpSessionSerializer

Change-Id: I50758befe28b3cf6bda4d63075c632dc1265774b
---
M README.md
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/php-session-serializer 
refs/changes/50/284850/1

diff --git a/README.md b/README.md
index ca1d0ba..aa07c42 100644
--- a/README.md
+++ b/README.md
@@ -15,19 +15,19 @@
 -
 
 
-use Wikimedia\PhpSesssionSerializer;
+use Wikimedia\PhpSessionSerializer;
 
 // (optional) Send logs to a PSR-3 logger
-PhpSesssionSerializer::setLogger( $logger )
+PhpSessionSerializer::setLogger( $logger )
 
 // (optional) Ensure that session.serialize_handler is set to a usable value
-PhpSesssionSerializer::setSerializeHandler();
+PhpSessionSerializer::setSerializeHandler();
 
 // Encode session data
-$string = PhpSesssionSerializer::encode( $array );
+$string = PhpSessionSerializer::encode( $array );
 
 // Decode session data
-$array = PhpSesssionSerializer::decode( $string );
+$array = PhpSessionSerializer::decode( $string );
 
 
 Running tests

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50758befe28b3cf6bda4d63075c632dc1265774b
Gerrit-PatchSet: 1
Gerrit-Project: php-session-serializer
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] travis: Add PHP 7.0 - change (php-session-serializer)

2016-04-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: travis: Add PHP 7.0
..

travis: Add PHP 7.0

Change-Id: Ieb2c9f99f328eea647a8c17c0fc8df249dfc75dd
---
M .travis.yml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/php-session-serializer 
refs/changes/49/284849/1

diff --git a/.travis.yml b/.travis.yml
index c25a516..8c4bb1f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,7 @@
   - "5.4"
   - "5.5"
   - "5.6"
+  - "7.0"
   - "hhvm"
 install:
   - composer install

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb2c9f99f328eea647a8c17c0fc8df249dfc75dd
Gerrit-PatchSet: 1
Gerrit-Project: php-session-serializer
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Use the plain-text GPL - change (RunningStat)

2016-04-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Use the plain-text GPL
..

Use the plain-text GPL

Change-Id: I9390509a34cbe0af4f3a7bfa0066d1f76271d9b6
---
M COPYING
1 file changed, 88 insertions(+), 91 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/RunningStat refs/changes/48/284848/1

diff --git a/COPYING b/COPYING
index 019694a..d159169 100644
--- a/COPYING
+++ b/COPYING
@@ -1,65 +1,65 @@
-== GNU GENERAL PUBLIC LICENSE ==
+GNU GENERAL PUBLIC LICENSE
+   Version 2, June 1991
 
-Version 2, June 1991
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
 
-Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
+Preamble
 
-=== Preamble ===
-
-The licenses for most software are designed to take away your
+  The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
 License is intended to guarantee your freedom to share and change free
 software--to make sure the software is free for all its users.  This
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
-When we speak of free software, we are referring to freedom, not
+  When we speak of free software, we are referring to freedom, not
 price.  Our General Public Licenses are designed to make sure that you
 have the freedom to distribute copies of free software (and charge for
 this service if you wish), that you receive source code or can get it
 if you want it, that you can change the software or use pieces of it
 in new free programs; and that you know you can do these things.
 
-To protect your rights, we need to make restrictions that forbid
+  To protect your rights, we need to make restrictions that forbid
 anyone to deny you these rights or to ask you to surrender the rights.
 These restrictions translate to certain responsibilities for you if you
 distribute copies of the software, or if you modify it.
 
-For example, if you distribute copies of such a program, whether
+  For example, if you distribute copies of such a program, whether
 gratis or for a fee, you must give the recipients all the rights that
 you have.  You must make sure that they, too, receive or can get the
 source code.  And you must show them these terms so they know their
 rights.
 
-We protect your rights with two steps: (1) copyright the software, and
+  We protect your rights with two steps: (1) copyright the software, and
 (2) offer you this license which gives you legal permission to copy,
 distribute and/or modify the software.
 
-Also, for each author's protection and ours, we want to make certain
+  Also, for each author's protection and ours, we want to make certain
 that everyone understands that there is no warranty for this free
 software.  If the software is modified by someone else and passed on, we
 want its recipients to know that what they have is not the original, so
 that any problems introduced by others will not reflect on the original
 authors' reputations.
 
-Finally, any free program is threatened constantly by software
+  Finally, any free program is threatened constantly by software
 patents.  We wish to avoid the danger that redistributors of a free
 program will individually obtain patent licenses, in effect making the
 program proprietary.  To prevent this, we have made it clear that any
 patent must be licensed for everyone's free use or not licensed at all.
 
-The precise terms and conditions for copying, distribution and
+  The precise terms and conditions for copying, distribution and
 modification follow.
 
-== TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ==
+GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
-'''0.''' This License applies to any program or other work which contains
+  0. This License applies to any program or other work which contains
 a notice placed by the copyright holder saying it may be distributed
 under the terms of this General Public License.  The "Program", below,
 refers to any such program or work, and a "work based on the Program"
@@ -76,7 +76,7 @@
 Program (independent of 

[MediaWiki-commits] [Gerrit] travis: Add PHP 7.0 - change (RunningStat)

2016-04-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: travis: Add PHP 7.0
..

travis: Add PHP 7.0

Change-Id: I399faea44c8e3fc87a3ff4fc52f5000a63e299c3
---
M .travis.yml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/RunningStat refs/changes/47/284847/1

diff --git a/.travis.yml b/.travis.yml
index c25a516..8c4bb1f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,7 @@
   - "5.4"
   - "5.5"
   - "5.6"
+  - "7.0"
   - "hhvm"
 install:
   - composer install

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I399faea44c8e3fc87a3ff4fc52f5000a63e299c3
Gerrit-PatchSet: 1
Gerrit-Project: RunningStat
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] travis: Add PHP 7.0 - change (RelPath)

2016-04-21 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: travis: Add PHP 7.0
..

travis: Add PHP 7.0

Change-Id: Ide6ea41f75097c254f280944cdc6dde18a938173
---
M .travis.yml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/RelPath refs/changes/44/284844/1

diff --git a/.travis.yml b/.travis.yml
index c25a516..8c4bb1f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,7 @@
   - "5.4"
   - "5.5"
   - "5.6"
+  - "7.0"
   - "hhvm"
 install:
   - composer install

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide6ea41f75097c254f280944cdc6dde18a938173
Gerrit-PatchSet: 1
Gerrit-Project: RelPath
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Bump grunt to 1.0.1, remove grunt-cli - change (mediawiki...Wikibase)

2016-04-12 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Bump grunt to 1.0.1, remove grunt-cli
..

Bump grunt to 1.0.1, remove grunt-cli

Change-Id: Idad8d1076502e669c5a49d653a1ee07e425bc87c
---
M package.json
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/package.json b/package.json
index 106d07d..fb78d91 100644
--- a/package.json
+++ b/package.json
@@ -11,8 +11,7 @@
   "author": "The Wikidata team",
   "license": "GPL-2.0+",
   "devDependencies": {
-"grunt": "0.4.5",
-"grunt-cli": "0.1.13",
+"grunt": "1.0.1",
 "grunt-banana-checker": "0.5.0",
 "grunt-contrib-jshint": "1.0.0",
 "grunt-jscs": "2.8.0",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idad8d1076502e669c5a49d653a1ee07e425bc87c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] WIP CategorySelector: use classes instead of switch for cate... - change (mediawiki/core)

2016-04-09 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: WIP CategorySelector: use classes instead of switch for 
category search types
..

WIP CategorySelector: use classes instead of switch for category search types

Change-Id: I1cecdad3049115852afdf9ae78dc894d28b0d1b4
---
M resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js
1 file changed, 150 insertions(+), 130 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/282455/1

diff --git a/resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js 
b/resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js
index 5d7d115..14f0b31 100644
--- a/resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js
+++ b/resources/src/mediawiki.widgets/mw.widgets.CategorySelector.js
@@ -9,6 +9,139 @@
NS_CATEGORY = mw.config.get( 'wgNamespaceIds' ).category;
 
/**
+* @class mw.widgets.CategorySelector.CategorySearchType
+* @uses mw.Api
+*
+* @constructor
+* @param {Object} config Configuration options
+* @cfg {mw.Api} api Instance of mw.Api (or subclass thereof) to use 
for queries
+*/
+   function CategorySearchType( config ) {
+   this.api = config.api;
+   }
+   CategorySearchType.prototype.mustBeTheOnlySearchType = false;
+
+   function OpenSearchCategorySearchType( config ) {
+   CategorySearchType.call( this, config );
+   }
+   OO.inheritClass( OpenSearchCategorySearchType, CategorySearchType );
+   OpenSearchCategorySearchType.prototype.searchCategories = function ( 
input, limit ) {
+   return this.api.get( {
+   formatversion: 2,
+   action: 'opensearch',
+   namespace: NS_CATEGORY,
+   limit: limit,
+   search: input
+   } ).then( function ( res ) {
+   return res[ 1 ];
+   } );
+   };
+
+   function InternalSearchCategorySearchType( config ) {
+   CategorySearchType.call( this, config );
+   }
+   OO.inheritClass( InternalSearchCategorySearchType, CategorySearchType );
+   InternalSearchCategorySearchType.prototype.searchCategories = function 
( input, limit ) {
+   return this.api.get( {
+   formatversion: 2,
+   action: 'query',
+   list: 'allpages',
+   apnamespace: NS_CATEGORY,
+   aplimit: limit,
+   apfrom: input,
+   apprefix: input
+   } ).then( function ( res ) {
+   return res.query.allpages.map( function ( page ) {
+   return page.title;
+   } );
+   } );
+   };
+
+   function ExistsCategorySearchType( config ) {
+   CategorySearchType.call( this, config );
+   }
+   OO.inheritClass( ExistsCategorySearchType, CategorySearchType );
+   ExistsCategorySearchType.prototype.searchCategories = function ( input 
) {
+   if ( input.indexOf( '|' ) > -1 ) {
+   return $.Deferred().resolve( [] );
+   }
+
+   return this.api.get( {
+   formatversion: 2,
+   action: 'query',
+   prop: 'info',
+   titles: 'Category:' + input
+   } ).then( function ( res ) {
+   var categories = [];
+
+   $.each( res.query.pages, function ( index, page ) {
+   if ( !page.missing ) {
+   categories.push( page.title );
+   }
+   } );
+
+   return categories;
+   } );
+   };
+
+   function SubCategoriesCategorySearchType( config ) {
+   CategorySearchType.call( this, config );
+   }
+   OO.inheritClass( SubCategoriesCategorySearchType, CategorySearchType );
+   SubCategoriesCategorySearchType.prototype.mustBeTheOnlySearchType = 
true;
+   SubCategoriesCategorySearchType.prototype.searchCategories = function ( 
input, limit ) {
+   if ( input.indexOf( '|' ) > -1 ) {
+   return $.Deferred().resolve( [] );
+   }
+
+   return this.api.get( {
+   formatversion: 2,
+   action: 'query',
+   list: 'categorymembers',
+   cmtype: 'subcat',
+   cmlimit: limit,
+   cmtitle: 'Category:' + input
+   } ).then( function ( res ) {
+   return 

[MediaWiki-commits] [Gerrit] Make some TablePager methods actually protected - change (mediawiki/core)

2016-04-08 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Make some TablePager methods actually protected
..

Make some TablePager methods actually protected

* getTableClass
* getNavClass
* getSortHeaderClass

Change-Id: I459ca456149635e3300c7ca7cfed4c1edc1c12b1
---
M includes/pager/TablePager.php
M includes/specials/SpecialProtectedpages.php
M includes/specials/pagers/BlockListPager.php
M includes/specials/pagers/ImageListPager.php
4 files changed, 8 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/53/282453/1

diff --git a/includes/pager/TablePager.php b/includes/pager/TablePager.php
index e22ceba..0a89e4e 100644
--- a/includes/pager/TablePager.php
+++ b/includes/pager/TablePager.php
@@ -264,26 +264,23 @@
}
 
/**
-* @protected
 * @return string
 */
-   function getTableClass() {
+   protected function getTableClass() {
return 'TablePager';
}
 
/**
-* @protected
 * @return string
 */
-   function getNavClass() {
+   protected function getNavClass() {
return 'TablePager_nav';
}
 
/**
-* @protected
 * @return string
 */
-   function getSortHeaderClass() {
+   protected function getSortHeaderClass() {
return 'TablePager_sort';
}
 
diff --git a/includes/specials/SpecialProtectedpages.php 
b/includes/specials/SpecialProtectedpages.php
index 8e9636e..54b471e 100644
--- a/includes/specials/SpecialProtectedpages.php
+++ b/includes/specials/SpecialProtectedpages.php
@@ -549,7 +549,7 @@
];
}
 
-   public function getTableClass() {
+   protected function getTableClass() {
return parent::getTableClass() . ' mw-protectedpages';
}
 
diff --git a/includes/specials/pagers/BlockListPager.php 
b/includes/specials/pagers/BlockListPager.php
index cfaf5c5..d822976 100644
--- a/includes/specials/pagers/BlockListPager.php
+++ b/includes/specials/pagers/BlockListPager.php
@@ -241,7 +241,7 @@
return $info;
}
 
-   public function getTableClass() {
+   protected function getTableClass() {
return parent::getTableClass() . ' mw-blocklist';
}
 
diff --git a/includes/specials/pagers/ImageListPager.php 
b/includes/specials/pagers/ImageListPager.php
index 258ac83..45fe5c4 100644
--- a/includes/specials/pagers/ImageListPager.php
+++ b/includes/specials/pagers/ImageListPager.php
@@ -561,15 +561,15 @@
$form->displayForm( '' );
}
 
-   function getTableClass() {
+   protected function getTableClass() {
return parent::getTableClass() . ' listfiles';
}
 
-   function getNavClass() {
+   protected function getNavClass() {
return parent::getNavClass() . ' listfiles_nav';
}
 
-   function getSortHeaderClass() {
+   protected function getSortHeaderClass() {
return parent::getSortHeaderClass() . ' listfiles_sort';
}
 

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

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

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


[MediaWiki-commits] [Gerrit] Convert SpecialItemDisambiguation to 'ooui' mode - change (mediawiki...Wikibase)

2016-04-07 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Convert SpecialItemDisambiguation to 'ooui' mode
..

Convert SpecialItemDisambiguation to 'ooui' mode

Replace wikibase.special.languageSuggester with combobox field.

Change-Id: I37213b8b319257716ec884ea4f643a12beea83a0
---
M repo/includes/Specials/SpecialItemDisambiguation.php
M repo/tests/phpunit/includes/Specials/SpecialItemDisambiguationTest.php
2 files changed, 43 insertions(+), 7 deletions(-)


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

diff --git a/repo/includes/Specials/SpecialItemDisambiguation.php 
b/repo/includes/Specials/SpecialItemDisambiguation.php
index 922e8e1..4fc0e53 100644
--- a/repo/includes/Specials/SpecialItemDisambiguation.php
+++ b/repo/includes/Specials/SpecialItemDisambiguation.php
@@ -44,6 +44,11 @@
private $contentLanguages;
 
/**
+* @var LanguageNameLookup
+*/
+   private $languageNameLookup;
+
+   /**
 * @var int
 */
private $limit;
@@ -56,8 +61,9 @@
public function __construct() {
parent::__construct( 'ItemDisambiguation', '', true );
 
-   // @todo inject this
+   // @todo inject these
$this->contentLanguages = new MediaWikiContentLanguages();
+   $this->languageNameLookup = new LanguageNameLookup();
 
// @todo make this configurable
$this->limit = 100;
@@ -70,15 +76,18 @@
 * @param ItemDisambiguation $itemDisambiguation
 * @param TermIndexSearchInteractor $searchInteractor
 * @param ContentLanguages $contentLanguages
+* @param LanguageNameLookup $languageNameLookup
 */
public function initServices(
ItemDisambiguation $itemDisambiguation,
TermIndexSearchInteractor $searchInteractor,
-   ContentLanguages $contentLanguages
+   ContentLanguages $contentLanguages,
+   LanguageNameLookup $languageNameLookup
) {
$this->itemDisambiguation = $itemDisambiguation;
$this->searchInteractor = $searchInteractor;
$this->contentLanguages = $contentLanguages;
+   $this->languageNameLookup = $languageNameLookup;
}
 
/**
@@ -251,19 +260,32 @@
}
 
/**
+* Return options for the language input field.
+*
+* @return array
+*/
+   private function getLanguageOptions() {
+   $options = array();
+   foreach ( $this->contentLanguages->getLanguages() as 
$languageCode ) {
+   $languageName = $this->languageNameLookup->getName( 
$languageCode );
+   $options["$languageName ($languageCode)"] = 
$languageCode;
+   }
+   return $options;
+   }
+
+   /**
 * Output a form to allow searching for labels
 *
 * @param string|null $languageCode
 * @param string|null $label
 */
private function switchForm( $languageCode, $label ) {
-   $this->getOutput()->addModules( 
'wikibase.special.languageSuggester' );
-
$formDescriptor = array(
'language' => array(
'name' => 'language',
'default' => $languageCode ?: '',
-   'type' => 'text',
+   'type' => 'combobox',
+   'options' => $this->getLanguageOptions(),
'id' => 'wb-itemdisambiguation-languagename',
'size' => 12,
'cssclass' => 'wb-language-suggester',
@@ -286,7 +308,7 @@
)
);
 
-   HTMLForm::factory( 'inline', $formDescriptor, 
$this->getContext() )
+   HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() 
)
->setId( 'wb-itemdisambiguation-form1' )
->setMethod( 'get' )
->setFooterText( Html::element(
diff --git 
a/repo/tests/phpunit/includes/Specials/SpecialItemDisambiguationTest.php 
b/repo/tests/phpunit/includes/Specials/SpecialItemDisambiguationTest.php
index aa6d576..ca13774 100644
--- a/repo/tests/phpunit/includes/Specials/SpecialItemDisambiguationTest.php
+++ b/repo/tests/phpunit/includes/Specials/SpecialItemDisambiguationTest.php
@@ -9,6 +9,7 @@
 use Wikibase\DataModel\Term\Term;
 use Wikibase\ItemDisambiguation;
 use Wikibase\Lib\Interactors\TermIndexSearchInteractor;
+use Wikibase\Lib\LanguageNameLookup;
 use Wikibase\Lib\StaticContentLanguages;
 use Wikibase\Repo\Specials\SpecialItemDisambiguation;
 use Wikibase\TermIndexEntry;
@@ 

[MediaWiki-commits] [Gerrit] Replace wikibase.special.languageSuggester with combobox field - change (mediawiki...Wikibase)

2016-04-07 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Replace wikibase.special.languageSuggester with combobox field
..

Replace wikibase.special.languageSuggester with combobox field

In SpecialEntitiesWithoutPage and SpecialItemDisambiguation.

Change-Id: I270afdbedc596783dc965b69c6558d9338be8fc8
---
M repo/Wikibase.hooks.php
M repo/includes/Specials/SpecialEntitiesWithoutPage.php
M repo/includes/Specials/SpecialEntitiesWithoutPageFactory.php
M repo/includes/Specials/SpecialItemDisambiguation.php
D repo/resources/wikibase.special/wikibase.special.languageSuggester.js
M repo/tests/phpunit/includes/Specials/SpecialEntitiesWithoutPageTest.php
M repo/tests/phpunit/includes/Specials/SpecialItemDisambiguationTest.php
7 files changed, 86 insertions(+), 65 deletions(-)


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

diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index 03f5d02..1f5877e 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -1072,14 +1072,6 @@
'wikibase',
),
),
-   'wikibase.special.languageSuggester' => $moduleTemplate 
+ array(
-   'scripts' => array(
-   
'resources/wikibase.special/wikibase.special.languageSuggester.js',
-   ),
-   'dependencies' => array(
-   'jquery.ui.suggester',
-   ),
-   ),
'wikibase.special.languageLabelDescriptionAliases' => 
$moduleTemplate + array(
'scripts' => array(

'resources/wikibase.special/wikibase.special.languageLabelDescriptionAliases.js',
@@ -1101,7 +1093,6 @@
$isUlsLoaded = ExtensionRegistry::getInstance()->isLoaded( 
'UniversalLanguageSelector' );
if ( $isUlsLoaded ) {

$modules['wikibase.WikibaseContentLanguages']['dependencies'][] = 
'ext.uls.languagenames';
-   
$modules['wikibase.special.languageSuggester']['dependencies'][] = 
'ext.uls.mediawiki';

$modules['wikibase.special.languageLabelDescriptionAliases']['dependencies'][] 
= 'ext.uls.mediawiki';
}
 
diff --git a/repo/includes/Specials/SpecialEntitiesWithoutPage.php 
b/repo/includes/Specials/SpecialEntitiesWithoutPage.php
index 3b27608..08606e9 100644
--- a/repo/includes/Specials/SpecialEntitiesWithoutPage.php
+++ b/repo/includes/Specials/SpecialEntitiesWithoutPage.php
@@ -5,6 +5,7 @@
 use HTMLForm;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\Lib\ContentLanguages;
+use Wikibase\Lib\LanguageNameLookup;
 use Wikibase\Repo\Store\EntityPerPage;
 
 /**
@@ -58,12 +59,18 @@
private $termsLanguages;
 
/**
+* @var LanguageNameLookup
+*/
+   private $languageNameLookup;
+
+   /**
 * @param string $name
 * @param string $termType One of the TermIndexEntry::TYPE_... 
constants.
 * @param string $legendMsg
 * @param EntityPerPage $entityPerPage
 * @param string[] $entityTypes
 * @param ContentLanguages $termsLanguages
+* @param LanguageNameLookup $languageNameLookup
 */
public function __construct(
$name,
@@ -71,7 +78,8 @@
$legendMsg,
EntityPerPage $entityPerPage,
array $entityTypes,
-   ContentLanguages $termsLanguages
+   ContentLanguages $termsLanguages,
+   LanguageNameLookup $languageNameLookup
) {
parent::__construct( $name );
 
@@ -80,6 +88,7 @@
$this->entityPerPage = $entityPerPage;
$this->entityTypes = $entityTypes;
$this->termsLanguages = $termsLanguages;
+   $this->languageNameLookup = $languageNameLookup;
}
 
/**
@@ -135,6 +144,20 @@
}
 
/**
+* Return options for the language input field.
+*
+* @return array
+*/
+   private function getLanguageOptions() {
+   $options = array();
+   foreach ( $this->termsLanguages->getLanguages() as 
$languageCode ) {
+   $languageName = $this->languageNameLookup->getName( 
$languageCode );
+   $options["$languageName ($languageCode)"] = 
$languageCode;
+   }
+   return $options;
+   }
+
+   /**
 * Build the HTML form
 */
private function setForm() {
@@ -147,13 +170,12 @@
$options[$this->msg( 'wikibase-entity-' . $type 

[MediaWiki-commits] [Gerrit] Use select field in Special:ItemByTitle - change (mediawiki...Wikibase)

2016-04-06 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Use select field in Special:ItemByTitle
..

Use select field in Special:ItemByTitle

Instead of a jQuery-UI-based suggester

Change-Id: Ifcbf53ba69fbf65e05a774a6cf99f3640ff31d79
---
M repo/includes/Specials/SpecialItemByTitle.php
M repo/resources/Resources.php
D repo/resources/wikibase.special/wikibase.special.itemByTitle.js
3 files changed, 4 insertions(+), 55 deletions(-)


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

diff --git a/repo/includes/Specials/SpecialItemByTitle.php 
b/repo/includes/Specials/SpecialItemByTitle.php
index 8bbf041..acce95e 100644
--- a/repo/includes/Specials/SpecialItemByTitle.php
+++ b/repo/includes/Specials/SpecialItemByTitle.php
@@ -178,13 +178,14 @@
 
wfDebugLog( __CLASS__, __FUNCTION__ . ": Site $siteId exists: " 
. var_export( $siteExists, true ) );
 
-   $this->getOutput()->addModules( 'wikibase.special.itemByTitle' 
);
+   $siteIds = $this->sites->getSites()->getGlobalIdentifiers();
 
$formDescriptor = array(
'site' => array(
'name' => 'site',
-   'default' => $siteId,
-   'type' => 'text',
+   'default' => $siteExists ? $siteId : reset( 
$siteIds ),
+   'type' => 'select',
+   'options' => array_combine( $siteIds, $siteIds 
),
'id' => 'wb-itembytitle-sitename',
'size' => 12,
'label-message' => 
'wikibase-itembytitle-lookup-site'
diff --git a/repo/resources/Resources.php b/repo/resources/Resources.php
index e935bbb..c5f8d05 100644
--- a/repo/resources/Resources.php
+++ b/repo/resources/Resources.php
@@ -142,17 +142,6 @@
),
),
 
-   'wikibase.special.itemByTitle' => $moduleTemplate + array(
-   'scripts' => array(
-   
'wikibase.special/wikibase.special.itemByTitle.js'
-   ),
-   'dependencies' => array(
-   'wikibase.sites',
-   'jquery.ui.suggester',
-   'oojs-ui'
-   )
-   ),
-
);
 
return array_merge(
diff --git a/repo/resources/wikibase.special/wikibase.special.itemByTitle.js 
b/repo/resources/wikibase.special/wikibase.special.itemByTitle.js
deleted file mode 100644
index 2d10b95..000
--- a/repo/resources/wikibase.special/wikibase.special.itemByTitle.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * JavaScript for 'wikibase' extension special page 'ItemByTitle'
- *
- * @since 0.1
- *
- * @license GPL-2.0+
- * @author Jens Ohlig
- */
-( function( $, mw, OO, wb ) {
-   'use strict';
-
-   $( document ).ready( function() {
-   if ( ( mw.config.get( 'wgCanonicalSpecialPageName' ) !== 
'ItemByTitle' ) ) {
-   return; // not the right special page
-   }
-
-   // this will build a drop-down for the language selection:
-   var sites = wb.sites.getSites(),
-   siteList = [];
-   for ( var siteId in sites ) {
-   if ( sites.hasOwnProperty( siteId ) ) {
-   siteList.push( sites[ siteId ].getName() + ' (' 
+ siteId + ')' );
-   }
-   }
-
-   var $input = OO.ui.infuse( $( '#wb-itembytitle-sitename' ) 
).$input;
-
-   $input
-   .attr( 'autocomplete', 'off' )
-   .suggester( { source: siteList } );
-   // Hackety hack hack...
-   // On submit, replace human readable value like "English (en)" 
with actual sitename ("enwiki")
-   $( '#wb-itembytitle-form1' ).submit( function() {
-   var langID = String( $input.val().replace( 
/.*\(|\).*/gi, '' ) );
-   if ( wb.sites.getSite( langID ).getId() !== undefined ) 
{
-   $input.val( wb.sites.getSite( langID ).getId() 
);
-   }
-   } );
-   } );
-
-} )( jQuery, mediaWiki, OO, wikibase );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifcbf53ba69fbf65e05a774a6cf99f3640ff31d79
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

___
MediaWiki-commits mailing list

[MediaWiki-commits] [Gerrit] Bump devDependencies to latest & tweak - change (pywikibot/i18n)

2016-04-05 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Bump devDependencies to latest & tweak
..

Bump devDependencies to latest & tweak

* grunt: from 0.4.2 to 1.0.1
* grunt-cli: dropped
* grunt-banana-checker: from 0.2.2 to 0.5.0,
  enable disallowUnusedTranslations, disable requireMetadata

Change-Id: I88bd7e5d968ff6d69ea289bcf476b55f005b13c2
---
M Gruntfile.js
M package.json
2 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/i18n 
refs/changes/74/281874/1

diff --git a/Gruntfile.js b/Gruntfile.js
index 971ed9f..e1abfcf 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -8,6 +8,10 @@
 
grunt.initConfig( {
banana: {
+   options: {
+   disallowUnusedTranslations: true,
+   requireMetadata: false
+   },
all: ['*/', '!node_modules/']
}
} );
diff --git a/package.json b/package.json
index 5387cac..949f27b 100644
--- a/package.json
+++ b/package.json
@@ -10,9 +10,8 @@
 "test": "grunt test"
   },
   "devDependencies": {
-"grunt": "0.4.2",
-"grunt-cli": "0.1.13",
-"grunt-banana-checker": "0.2.2"
+"grunt": "1.0.1",
+"grunt-banana-checker": "0.5.0"
   }
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88bd7e5d968ff6d69ea289bcf476b55f005b13c2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Bump grunt to 1.0.0, remove grunt-cli - change (mediawiki/core)

2016-04-04 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Bump grunt to 1.0.0, remove grunt-cli
..

Bump grunt to 1.0.0, remove grunt-cli

Change-Id: Ic04c3a0b0237c8785f54b83f1bcfb64a3978d768
---
M package.json
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/281592/1

diff --git a/package.json b/package.json
index 8bfb94d..cb2be1d 100644
--- a/package.json
+++ b/package.json
@@ -6,8 +6,7 @@
 "postdoc": "grunt copy:jsduck"
   },
   "devDependencies": {
-"grunt": "0.4.5",
-"grunt-cli": "0.1.13",
+"grunt": "1.0.0",
 "grunt-banana-checker": "0.5.0",
 "grunt-contrib-copy": "1.0.0",
 "grunt-contrib-jshint": "1.0.0",

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

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

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


[MediaWiki-commits] [Gerrit] TextInputWidget: remove isValid() method, deprecated since v... - change (oojs/ui)

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

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

Change subject: TextInputWidget: remove isValid() method, deprecated since 
v0.12.3
..

TextInputWidget: remove isValid() method, deprecated since v0.12.3

Change-Id: Ic80483366abbf47140b8073935ff2a697271aec9
---
M src/widgets/TextInputWidget.js
1 file changed, 0 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/26/281226/1

diff --git a/src/widgets/TextInputWidget.js b/src/widgets/TextInputWidget.js
index a9e5fee..70325a9 100644
--- a/src/widgets/TextInputWidget.js
+++ b/src/widgets/TextInputWidget.js
@@ -682,30 +682,6 @@
 };
 
 /**
- * Check if a value is valid.
- *
- * This method returns a promise that resolves with a boolean `true` if the 
current value is
- * considered valid according to the supplied {@link #validate validation 
pattern}.
- *
- * @deprecated since v0.12.3
- * @return {jQuery.Promise} A promise that resolves to a boolean `true` if the 
value is valid.
- */
-OO.ui.TextInputWidget.prototype.isValid = function () {
-   var result;
-
-   if ( this.validate instanceof Function ) {
-   result = this.validate( this.getValue() );
-   if ( result && $.isFunction( result.promise ) ) {
-   return result.promise();
-   } else {
-   return $.Deferred().resolve( !!result ).promise();
-   }
-   } else {
-   return $.Deferred().resolve( !!this.getValue().match( 
this.validate ) ).promise();
-   }
-};
-
-/**
  * Get the validity of current value.
  *
  * This method returns a promise that resolves if the value is valid and 
rejects if

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic80483366abbf47140b8073935ff2a697271aec9
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] TextInputWidget: Use getValidity in demos - change (oojs/ui)

2016-03-31 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: TextInputWidget: Use getValidity in demos
..

TextInputWidget: Use getValidity in demos

Instead of the deprecated isValid method.

Change-Id: Iaf73379a2d7bdc62306290ba5b19144ab405b9ee
---
M demos/pages/widgets.js
1 file changed, 8 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/01/280801/1

diff --git a/demos/pages/widgets.js b/demos/pages/widgets.js
index 2820c58..165b298 100644
--- a/demos/pages/widgets.js
+++ b/demos/pages/widgets.js
@@ -116,16 +116,14 @@
deferred = $.Deferred(),
delay = 500 + Math.floor( Math.random() * 500 );
 
-   this.isValid().done( function ( valid ) {
-   if ( valid ) {
-   // Resolve with results after a faked delay
-   setTimeout( function () {
-   deferred.resolve( [ value * 1, value * 
2, value * 3, value * 4, value * 5 ] );
-   }, delay );
-   } else {
-   // No results when the input contains invalid 
content
-   deferred.resolve( [] );
-   }
+   this.getValidity().then( function () {
+   // Resolve with results after a faked delay
+   setTimeout( function () {
+   deferred.resolve( [ value * 1, value * 2, value 
* 3, value * 4, value * 5 ] );
+   }, delay );
+   }, function () {
+   // No results when the input contains invalid content
+   deferred.resolve( [] );
} );
 
return deferred.promise( { abort: function () {} } );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf73379a2d7bdc62306290ba5b19144ab405b9ee
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Travis CI: test also on PHP 7.0 - change (IPSet)

2016-03-28 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Travis CI: test also on PHP 7.0
..

Travis CI: test also on PHP 7.0

Change-Id: I77c54b25ea8a8e5624b03b8f375d2ec5c87af478
---
M .travis.yml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/IPSet refs/changes/54/279954/1

diff --git a/.travis.yml b/.travis.yml
index 3d4019f..125a0c6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,6 +5,7 @@
   - "5.4"
   - "5.5"
   - "5.6"
+  - "7.0"
   - "hhvm"
 sudo: false
 install:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77c54b25ea8a8e5624b03b8f375d2ec5c87af478
Gerrit-PatchSet: 1
Gerrit-Project: IPSet
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] Add missing 'public' keywords to some Language methods - change (mediawiki/core)

2016-03-24 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Add missing 'public' keywords to some Language methods
..

Add missing 'public' keywords to some Language methods

All of them are already being used outside the class:
* getFallbackLanguages
* getBookstoreList
* getFormattedNamespaces
* getNsText
* getFormattedNsText
* getGenderNsText
* needsGenderDistinction
* getNamespaceAliases
* getNamespaceIds
* getNsIndex
* getVariantname
* getDatePreferences
* getDefaultDateFormat
* getDatePreferenceMigrationMap
* getImageFiles
* getExtraUserToggles
* getMessageFromDB
* getMonthName
* getMonthNamesArray
* getMonthNameGen

Change-Id: Iff5495596c5a711259c45b4d57c453aad9526a9a
---
M languages/Language.php
1 file changed, 20 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/279351/1

diff --git a/languages/Language.php b/languages/Language.php
index 93ce8eb..f13f9d6 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -443,7 +443,7 @@
 * @return array
 * @since 1.19
 */
-   function getFallbackLanguages() {
+   public function getFallbackLanguages() {
return self::getFallbacksFor( $this->mCode );
}
 
@@ -451,7 +451,7 @@
 * Exports $wgBookstoreListEn
 * @return array
 */
-   function getBookstoreList() {
+   public function getBookstoreList() {
return self::$dataCache->getItem( $this->mCode, 'bookstoreList' 
);
}
 
@@ -520,7 +520,7 @@
 *
 * @return array
 */
-   function getFormattedNamespaces() {
+   public function getFormattedNamespaces() {
$ns = $this->getNamespaces();
foreach ( $ns as $k => $v ) {
$ns[$k] = strtr( $v, '_', ' ' );
@@ -539,7 +539,7 @@
 * @param int $index The array key of the namespace to return
 * @return string|bool String if the namespace value exists, otherwise 
false
 */
-   function getNsText( $index ) {
+   public function getNsText( $index ) {
$ns = $this->getNamespaces();
return isset( $ns[$index] ) ? $ns[$index] : false;
}
@@ -557,7 +557,7 @@
 * @param int $index The array key of the namespace to return
 * @return string Namespace name without underscores (empty string if 
namespace does not exist)
 */
-   function getFormattedNsText( $index ) {
+   public function getFormattedNsText( $index ) {
$ns = $this->getNsText( $index );
return strtr( $ns, '_', ' ' );
}
@@ -570,7 +570,7 @@
 * @return string
 * @since 1.18
 */
-   function getGenderNsText( $index, $gender ) {
+   public function getGenderNsText( $index, $gender ) {
global $wgExtraGenderNamespaces;
 
$ns = $wgExtraGenderNamespaces +
@@ -585,7 +585,7 @@
 * @return bool
 * @since 1.18
 */
-   function needsGenderDistinction() {
+   public function needsGenderDistinction() {
global $wgExtraGenderNamespaces, $wgExtraNamespaces;
if ( count( $wgExtraGenderNamespaces ) > 0 ) {
// $wgExtraGenderNamespaces overrides everything
@@ -618,7 +618,7 @@
/**
 * @return array
 */
-   function getNamespaceAliases() {
+   public function getNamespaceAliases() {
if ( is_null( $this->namespaceAliases ) ) {
$aliases = self::$dataCache->getItem( $this->mCode, 
'namespaceAliases' );
if ( !$aliases ) {
@@ -662,7 +662,7 @@
/**
 * @return array
 */
-   function getNamespaceIds() {
+   public function getNamespaceIds() {
if ( is_null( $this->mNamespaceIds ) ) {
global $wgNamespaceAliases;
# Put namespace names and aliases into a hashtable.
@@ -692,7 +692,7 @@
 * @param string $text
 * @return int|bool An integer if $text is a valid value otherwise false
 */
-   function getNsIndex( $text ) {
+   public function getNsIndex( $text ) {
$lctext = $this->lc( $text );
$ns = MWNamespace::getCanonicalIndex( $lctext );
if ( $ns !== null ) {
@@ -709,7 +709,7 @@
 * @param bool $usemsg Use the "variantname-xyz" message if it exists
 * @return string
 */
-   function getVariantname( $code, $usemsg = true ) {
+   public function getVariantname( $code, $usemsg = true ) {
$msg = "variantname-$code";
if ( $usemsg && wfMessage( $msg )->exists() ) {
return $this->getMessageFromDB( $msg );
@@ -726,7 +726,7 @@
/**
 * @return array
 

[MediaWiki-commits] [Gerrit] WIP TODO DONOTMERGE Refactor babel boxes into classes - change (mediawiki...Babel)

2016-03-24 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: WIP TODO DONOTMERGE Refactor babel boxes into classes
..

WIP TODO DONOTMERGE Refactor babel boxes into classes

Change-Id: Ibed6e8952617f2d7c12e08dfb9aa79a8a927b14f
---
M Babel.class.php
A BabelBox/BabelBox.php
A BabelBox/LanguageBabelBox.php
A BabelBox/NotBabelBox.php
A BabelBox/NullBabelBox.php
5 files changed, 337 insertions(+), 182 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel 
refs/changes/41/279341/1

diff --git a/Babel.class.php b/Babel.class.php
index d269421..c09f07e 100644
--- a/Babel.class.php
+++ b/Babel.class.php
@@ -126,40 +126,51 @@
$template = wfMessage( 'babel-template', $name 
)->inContentLanguage()->text();
 
if ( $name === '' ) {
-   return '';
+   $box = new NullBabelBox();
} elseif ( $components !== false ) {
// Valid parameter syntax (with lowercase language 
code), babel box
-   return self::mGenerateBox( $components['code'], 
$components['level'] )
-   . self::mGenerateCategories(
-   $components['code'],
-   $components['level'],
-   $createCategories
-   );
+   $box = new LanguageBabelBox(
+   self::$title,
+   $components['code'],
+   $components['level'],
+   $createCategories
+   );
} elseif ( self::mPageExists( $template ) ) {
// Check for an existing template
$templateParameters[0] = $template;
$template = implode( '|', $templateParameters );
-   return self::mGenerateNotaBox( 
$parser->replaceVariables( "{{{$template}}}" ) );
+   $box = new NotBabelBox(
+   self::$title->getPageLanguage()->getDir(),
+   $parser->replaceVariables( "{{{$template}}}" )
+   );
} elseif ( self::mValidTitle( $template ) ) {
// Non-existing page, so try again as a babel box,
// with converting the code to lowercase
$components2 = self::mParseParameter( $name, /* code to 
lowercase */
true );
if ( $components2 !== false ) {
-   return self::mGenerateBox( 
$components2['code'], $components2['level'] )
-   . self::mGenerateCategories(
-   $components2['code'],
-   $components2['level'],
-   $createCategories
-   );
+   $box = new LanguageBabelBox(
+   self::$title,
+   $components2['code'],
+   $components2['level'],
+   $createCategories
+   );
} else {
// Non-existent page and invalid parameter 
syntax, red link.
-   return self::mGenerateNotaBox( '[[' . $template 
. ']]' );
+   $box = new NotBabelBox(
+   
self::$title->getPageLanguage()->getDir(),
+   '[[' . $template . ']]'
+   );
}
} else {
// Invalid title, output raw.
-   return self::mGenerateNotaBox( $template );
+   $box = new NotBabelBox(
+   self::$title->getPageLanguage()->getDir(),
+   $template
+   );
}
+
+   return $box->render();
}
 
/**
@@ -246,172 +257,6 @@
$return['level'] = $level;
 
return $return;
-   }
-
-   /**
-* Generate an inner item which is not a babel box.
-*
-* @param string $content What's inside the box, in wikitext format.
-* @return string A single non-babel box, in wikitext format.
-*/
-   protected static function mGenerateNotaBox( $content ) {
-   $dir_head = self::$title->getPageLanguage()->getDir();
-   $notabox = <<$content
-EOT;
-
-   return 

[MediaWiki-commits] [Gerrit] Clean up Doxygen tags - change (mediawiki...Babel)

2016-03-24 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Clean up Doxygen tags
..

Clean up Doxygen tags

* Use "@param datatype $paramname description"
  and "@return datatype description" formats

* Capitalize descriptions

* Indent descriptions spanning multiple lines

Change-Id: I7ac38b3bed8f38c78c9ef0149dadb10cd59e5b31
---
M Babel.class.php
M BabelAutoCreate.class.php
M BabelLanguageCodes.class.php
M BabelStatic.class.php
4 files changed, 43 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel 
refs/changes/18/279318/1

diff --git a/Babel.class.php b/Babel.class.php
index 41241bc..d269421 100644
--- a/Babel.class.php
+++ b/Babel.class.php
@@ -27,7 +27,7 @@
 *
 * @param Parser $parser
 * @param string [$parameter,...]
-* @return string: Babel tower.
+* @return string Babel tower.
 */
public static function Render( Parser $parser ) {
global $wgBabelUseUserLanguage;
@@ -184,8 +184,8 @@
/**
 * Identify whether or not a page exists.
 *
-* @param $name String: Name of the page to check.
-* @return Boolean: Indication of whether the page exists.
+* @param string $name Name of the page to check.
+* @return bool Indication of whether the page exists.
 */
protected static function mPageExists( $name ) {
$titleObj = Title::newFromText( $name );
@@ -196,8 +196,8 @@
/**
 * Identify whether or not the passed string would make a valid page 
name.
 *
-* @param $name string: Name of page to check.
-* @return Boolean: Indication of whether or not the title is valid.
+* @param string $name Name of page to check.
+* @return bool Indication of whether or not the title is valid.
 */
protected static function mValidTitle( $name ) {
$titleObj = Title::newFromText( $name );
@@ -208,9 +208,9 @@
/**
 * Parse a parameter, getting a language code and level.
 *
-* @param $parameter String: Parameter.
-* @param $strtolower Boolean: Whether to convert the language code to 
lowercase
-* @return Array: { 'code' => xx, 'level' => xx }
+* @param string $parameter Parameter.
+* @param bool $strtolower Whether to convert the language code to 
lowercase
+* @return array [ 'code' => xx, 'level' => xx ]
 */
protected static function mParseParameter( $parameter, $strtolower = 
false ) {
global $wgBabelDefaultLevel, $wgBabelCategoryNames;
@@ -251,8 +251,8 @@
/**
 * Generate an inner item which is not a babel box.
 *
-* @param $content String: what's inside the box, in wikitext format.
-* @return String: A single non-babel box, in wikitext format.
+* @param string $content What's inside the box, in wikitext format.
+* @return string A single non-babel box, in wikitext format.
 */
protected static function mGenerateNotaBox( $content ) {
$dir_head = self::$title->getPageLanguage()->getDir();
@@ -266,9 +266,9 @@
/**
 * Generate a babel box for the given language and level.
 *
-* @param $code String: Language code to use.
-* @param $level String or Integer: Level of ability to use.
-* @return String: A single babel box, in wikitext format.
+* @param string $code Language code to use.
+* @param string|int $level Level of ability to use.
+* @return string A single babel box, in wikitext format.
 */
protected static function mGenerateBox( $code, $level ) {
$lang = wfBCP47( $code );
@@ -316,10 +316,10 @@
 * Get the text to display in the language box for specific language and
 * level.
 *
-* @param $name string
-* @param $language String: Language code of language to use.
-* @param $level String: Level to use.
-* @return String: Text for display, in wikitext format.
+* @param string $name
+* @param string $language Language code of language to use.
+* @param string $level Level to use.
+* @return string Text for display, in wikitext format.
 */
protected static function mGetText( $name, $language, $level ) {
global $wgBabelMainCategory, $wgBabelCategoryNames;
@@ -363,11 +363,11 @@
/**
 * Generate categories for the given language and level.
 *
-* @param $code String: Language code to use.
-* @param $level String or Integer: Level of ability to use.
-* @param $createCategories Boolean: If true, creates non existing 
categories;
-* otherwise, doesn't create them.
-* 

[MediaWiki-commits] [Gerrit] Always use 'bool' instead of 'boolean' in Doxygen tags - change (mediawiki/core)

2016-03-24 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: Always use 'bool' instead of 'boolean' in Doxygen tags
..

Always use 'bool' instead of 'boolean' in Doxygen tags

Just like commit f86a5590aae7fbe6d9b8a3d129c7a04a11a27579

Change-Id: Ic9d08bca6524d6bb4baf5170c081ad0f3d738e28
---
M includes/MergeHistory.php
M includes/TemplateParser.php
M includes/Title.php
M includes/api/ApiBase.php
M includes/api/ApiMain.php
M includes/api/ApiResult.php
M includes/filerepo/FileRepo.php
M includes/htmlform/VFormHTMLForm.php
M includes/libs/MWMessagePack.php
M includes/media/WebP.php
M includes/poolcounter/PoolCounter.php
M includes/resourceloader/ResourceLoaderRawFileModule.php
M includes/site/HashSiteStore.php
M includes/utils/BatchRowIterator.php
M includes/utils/MWCryptHash.php
M tests/phpunit/MediaWikiTestCase.php
16 files changed, 26 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/11/279311/1

diff --git a/includes/MergeHistory.php b/includes/MergeHistory.php
index a92056d..441fe9e 100644
--- a/includes/MergeHistory.php
+++ b/includes/MergeHistory.php
@@ -51,7 +51,7 @@
/** @var string SQL WHERE condition that selects source revisions to 
insert into destination */
protected $timeWhere;
 
-   /** @var MWTimestamp|boolean Timestamp upto which history from the 
source will be merged */
+   /** @var MWTimestamp|bool Timestamp upto which history from the source 
will be merged */
protected $timestampLimit;
 
/** @var integer Number of revisions merged (for Special:MergeHistory 
success message) */
@@ -61,7 +61,7 @@
 * MergeHistory constructor.
 * @param Title $source Page from which history will be merged
 * @param Title $dest Page to which history will be merged
-* @param string|boolean $timestamp Timestamp up to which history from 
the source will be merged
+* @param string|bool $timestamp Timestamp up to which history from the 
source will be merged
 */
public function __construct( Title $source, Title $dest, $timestamp = 
false ) {
// Save the parameters
diff --git a/includes/TemplateParser.php b/includes/TemplateParser.php
index 6420dc7..20142a7 100644
--- a/includes/TemplateParser.php
+++ b/includes/TemplateParser.php
@@ -38,7 +38,7 @@
 
/**
 * @param string $templateDir
-* @param boolean $forceRecompile
+* @param bool $forceRecompile
 */
public function __construct( $templateDir = null, $forceRecompile = 
false ) {
$this->templateDir = $templateDir ?: __DIR__ . '/templates';
diff --git a/includes/Title.php b/includes/Title.php
index 262c6fa..8bafe26 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -145,7 +145,7 @@
/** @var bool The (string) language code of the page's language and 
content code. */
private $mPageLanguage = false;
 
-   /** @var string|boolean|null The page language code from the database, 
null if not saved in
+   /** @var string|bool|null The page language code from the database, 
null if not saved in
 * the database or false if not loaded, yet. */
private $mDbPageLanguage = false;
 
@@ -4627,7 +4627,7 @@
 * to true in LocalSettings.php, otherwise returns false. If there is 
no language saved in
 * the db, it will return NULL.
 *
-* @return string|null|boolean
+* @return string|null|bool
 */
private function getDbPageLanguageCode() {
global $wgPageLanguageUseDB;
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index 7944167..1c20229 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -437,7 +437,7 @@
 *RFC 7232 § 2.2 for semantics.
 *  - etag: Return an entity-tag representing the state of all 
resources involved
 *in the request. Quotes must be included. See RFC 7232 § 2.3 for 
semantics.
-* @return string|boolean|null As described above, or null if no value 
is available.
+* @return string|bool|null As described above, or null if no value is 
available.
 */
public function getConditionalRequestData( $condition ) {
return null;
diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index df3f516..63b79ac 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -711,7 +711,7 @@
 
/**
 * Send caching headers
-* @param boolean $isError Whether an error response is being output
+* @param bool $isError Whether an error response is being output
 * @since 1.26 added $isError parameter
 */
protected function sendCacheHeaders( $isError ) {
diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php
index 3436320..5d5c829 100644

[MediaWiki-commits] [Gerrit] grunt-banana-checker: ignore log directory - change (pywikibot/i18n)

2016-03-19 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: grunt-banana-checker: ignore log directory
..

grunt-banana-checker: ignore log directory

As per commit 8eac9c1dd2662abf19c29e01ab72766759b06d20
in integration/config.

Change-Id: I5af2bfe1f0ebe6eedc5fc4909cfca438f7739eec
---
M Gruntfile.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/i18n 
refs/changes/69/277769/1

diff --git a/Gruntfile.js b/Gruntfile.js
index 971ed9f..23ed8ac 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -8,7 +8,7 @@
 
grunt.initConfig( {
banana: {
-   all: ['*/', '!node_modules/']
+   all: ['*/', '!log/', '!node_modules/']
}
} );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5af2bfe1f0ebe6eedc5fc4909cfca438f7739eec
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

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


[MediaWiki-commits] [Gerrit] build: Remove redundant jscs rule 'disallowQuotedKeysInObjects' - change (mediawiki/core)

2016-03-19 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: build: Remove redundant jscs rule 'disallowQuotedKeysInObjects'
..

build: Remove redundant jscs rule 'disallowQuotedKeysInObjects'

{ "allExcept": [ "reserved" ] } found in the wikimedia preset is
the same as the customized "allButReserved" present in MediaWiki,
except that the latter is deprecated as stated at:
http://jscs.info/rule/disallowQuotedKeysInObjects

Change-Id: I5de2a8f7ad42857ccdc793551d08c77e2aae8156
---
M .jscsrc
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/48/278248/1

diff --git a/.jscsrc b/.jscsrc
index 116c5cf..f3db218 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -4,7 +4,6 @@
 
"requireVarDeclFirst": null,
 
-   "disallowQuotedKeysInObjects": "allButReserved",
"requireDotNotation": { "allExcept": [ "keywords" ] },
"jsDoc": {
"checkAnnotations": {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki.api: warn on requests for legacy token types - change (mediawiki/core)

2016-03-15 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: mediawiki.api: warn on requests for legacy token types
..

mediawiki.api: warn on requests for legacy token types

Change-Id: Ia2c795a95b58f62f4687501a5537e5890d90144e
---
M resources/src/mediawiki/api.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/277523/1

diff --git a/resources/src/mediawiki/api.js b/resources/src/mediawiki/api.js
index 10e0c56..b3162a0 100644
--- a/resources/src/mediawiki/api.js
+++ b/resources/src/mediawiki/api.js
@@ -39,7 +39,11 @@
'import',
'options'
];
-   return $.inArray( action, csrfActions ) !== -1 ? 'csrf' : 
action;
+   if ( $.inArray( action, csrfActions ) !== -1 ) {
+   mw.log.warn( 'Use of the "' + action + '" token is 
deprecated. Use "csrf" instead.' );
+   return 'csrf';
+   }
+   return action;
}
 
// Pre-populate with fake ajax promises to save http requests for tokens

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

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

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


  1   2   3   4   5   6   7   >