Skip to content

Commit fbc9f67

Browse files
authored
Merge pull request #42 from wmde/csTravis
Start using extension.json and enable PHPCS on Travis
2 parents 20822d8 + 51a6299 commit fbc9f67

File tree

8 files changed

+33
-16
lines changed

8 files changed

+33
-16
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ php:
66
sudo: false
77

88
before_script:
9+
- composer install --prefer-source
910
- nvm install 4
1011

11-
script: npm install && npm run eslint
12+
script:
13+
- composer test
14+
- npm install && npm run eslint
1215

1316
notifications:
1417
irc:

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ version 2.0 of this package:
2121

2222
## Release notes
2323

24+
### 2.1.0 (dev)
25+
26+
* Updated the MediaWiki entry point to use the extension.json format.
27+
* Added code sniffers for JavaScript as well as PHP.
28+
* Dropped compatibility with PHP 5.3.
29+
2430
### 2.0.8 (2016-09-09)
2531

2632
* Fix an issue with MediaWiki loading (init.mw.php)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"scripts": {
3232
"fix": "phpcbf",
3333
"test": [
34-
"vendor/bin/phpcs . -p -s"
34+
"phpcs -p -s"
3535
]
3636
}
3737
}

init.mw.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44
die( 'Not an entry point.' );
55
}
66

7-
$GLOBALS['wgExtensionCredits']['wikibase'][] = [
8-
'path' => __FILE__,
9-
'name' => 'Wikibase Serialization JavaScript',
10-
'version' => WIKIBASE_SERIALIZATION_JAVASCRIPT_VERSION,
11-
'author' => [
12-
'[http://www.snater.com H. Snater]',
13-
],
14-
'url' => 'https://github.com/wmde/WikibaseSerializationJavaScript',
15-
'description' => 'JavaScript library containing serializers and deserializers for the Wikibase DataModel.',
16-
'license-name' => 'GPL-2.0+',
17-
];
7+
if ( function_exists( 'wfLoadExtension' ) ) {
8+
wfLoadExtension( 'WikibaseSerializationJavaScript', __DIR__ . '/mediawiki-extension.json' );
9+
}
1810

1911
include __DIR__ . '/resources.php';
2012
include __DIR__ . '/resources.tests.php';

init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
define( 'WIKIBASE_SERIALIZATION_JAVASCRIPT_VERSION', '2.0.8' );
3+
define( 'WIKIBASE_SERIALIZATION_JAVASCRIPT_VERSION', '2.1.0' );
44

55
if ( defined( 'MEDIAWIKI' ) ) {
66
call_user_func( function() {

mediawiki-extension.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "Wikibase Serialization JavaScript",
3+
"version": "2.1.0",
4+
"author": [
5+
"[http://www.snater.com H. Snater]"
6+
],
7+
"url": "https://github.com/wmde/WikibaseSerializationJavaScript",
8+
"description": "JavaScript library containing serializers and deserializers for the Wikibase DataModel.",
9+
"license-name": "GPL-2.0+",
10+
"type": "wikibase",
11+
"manifest_version": 1
12+
}

phpcs.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?xml version="1.0"?>
22
<ruleset name="SerializationJavaScript">
3-
<rule ref="vendor/wikibase/wikibase-codesniffer/Wikibase" />
3+
<rule ref="./vendor/wikibase/wikibase-codesniffer/Wikibase" />
4+
45
<rule ref="Generic.Files.LineLength">
56
<properties>
67
<property name="lineLimit" value="108" />
78
</properties>
89
</rule>
10+
11+
<file>.</file>
12+
<exclude-pattern>node_modules</exclude-pattern>
913
</ruleset>

tests/SerializerFactory.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ QUnit.test( 'registerSerializer(), newSerializerFor()', function( assert ) {
4646
);
4747

4848
assert.ok(
49-
serializerFactory.newSerializerFor( new ( testSets[0].Constructor ) ).constructor
49+
serializerFactory.newSerializerFor( new testSets[0].Constructor() ).constructor
5050
=== testSets[0].Serializer,
5151
'Retrieved serializer by object.'
5252
);

0 commit comments

Comments
 (0)