Skip to content

Commit 946cc77

Browse files
Merge pull request #773 from wmde/wikibaseCs03
Update the Wikibase CodeSniffer rule set to version 0.3
2 parents 2009e80 + 9bd5fdd commit 946cc77

8 files changed

Lines changed: 34 additions & 36 deletions

File tree

phpcs.xml renamed to .phpcs.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?xml version="1.0"?>
2-
<ruleset name="WikibaseDataModel">
3-
<rule ref="./vendor/wikibase/wikibase-codesniffer/Wikibase">
4-
<exclude name="PSR2.Methods.MethodDeclaration" />
5-
</rule>
2+
<ruleset>
3+
<rule ref="./vendor/wikibase/wikibase-codesniffer/Wikibase" />
64

75
<rule ref="Generic.Files.LineLength">
86
<properties>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"ockcyp/covers-validator": "~0.4.0",
3232
"phpmd/phpmd": "~2.3",
3333
"phpunit/phpunit": "~4.8",
34-
"wikibase/wikibase-codesniffer": "^0.1.0"
34+
"wikibase/wikibase-codesniffer": "^0.3.0"
3535
},
3636
"autoload": {
3737
"files" : [

src/Entity/EntityId.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct( $serialization ) {
4343
self::assertValidSerialization( $serialization );
4444
$this->serialization = self::normalizeIdSerialization( $serialization );
4545

46-
list ( $this->repositoryName, $this->localPart ) = self::extractRepositoryNameAndLocalPart( $serialization );
46+
list( $this->repositoryName, $this->localPart ) = self::extractRepositoryNameAndLocalPart( $serialization );
4747
}
4848

4949
private static function assertValidSerialization( $serialization ) {
@@ -63,7 +63,7 @@ private static function assertValidSerialization( $serialization ) {
6363
/**
6464
* @return string
6565
*/
66-
public abstract function getEntityType();
66+
abstract public function getEntityType();
6767

6868
/**
6969
* @return string

src/Entity/ItemId.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function serialize() {
8383
public function unserialize( $serialized ) {
8484
$array = json_decode( $serialized );
8585
$this->serialization = is_array( $array ) ? $array[1] : $serialized;
86-
list ( $this->repositoryName, $this->localPart ) =
86+
list( $this->repositoryName, $this->localPart ) =
8787
self::extractRepositoryNameAndLocalPart( $this->serialization );
8888
}
8989

src/Entity/PropertyId.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function serialize() {
8383
public function unserialize( $serialized ) {
8484
$array = json_decode( $serialized );
8585
$this->serialization = is_array( $array ) ? $array[1] : $serialized;
86-
list ( $this->repositoryName, $this->localPart ) =
86+
list( $this->repositoryName, $this->localPart ) =
8787
self::extractRepositoryNameAndLocalPart( $this->serialization );
8888
}
8989

src/ReferenceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public function equals( $target ) {
281281
}
282282

283283
return $target instanceof self
284-
&& $this->getValueHash() === $target->getValueHash();
284+
&& $this->getValueHash() === $target->getValueHash();
285285
}
286286

287287
/**

tests/unit/Entity/ItemTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -448,25 +448,25 @@ public function testSetDescription( $languageCode, $description, $moarText = 'oh
448448
public function aliasesProvider() {
449449
return [
450450
[ [
451-
'en' => [ [ 'spam' ] ]
452-
] ],
451+
'en' => [ [ 'spam' ] ],
452+
] ],
453453
[ [
454-
'en' => [ [ 'foo', 'bar', 'baz' ] ]
455-
] ],
454+
'en' => [ [ 'foo', 'bar', 'baz' ] ],
455+
] ],
456456
[ [
457-
'en' => [ [ 'foo', 'bar' ], [ 'baz', 'spam' ] ]
458-
] ],
457+
'en' => [ [ 'foo', 'bar' ], [ 'baz', 'spam' ] ],
458+
] ],
459459
[ [
460-
'en' => [ [ 'foo', 'bar', 'baz' ] ],
461-
'de' => [ [ 'foobar' ], [ 'baz' ] ],
462-
] ],
460+
'en' => [ [ 'foo', 'bar', 'baz' ] ],
461+
'de' => [ [ 'foobar' ], [ 'baz' ] ],
462+
] ],
463463
// with duplicates
464464
[ [
465-
'en' => [ [ 'spam', 'ham', 'ham' ] ]
466-
] ],
465+
'en' => [ [ 'spam', 'ham', 'ham' ] ],
466+
] ],
467467
[ [
468-
'en' => [ [ 'foo', 'bar' ], [ 'bar', 'spam' ] ]
469-
] ],
468+
'en' => [ [ 'foo', 'bar' ], [ 'bar', 'spam' ] ],
469+
] ],
470470
];
471471
}
472472

tests/unit/Entity/PropertyTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -325,25 +325,25 @@ public function testSetDescription( $languageCode, $description, $moarText = 'oh
325325
public function aliasesProvider() {
326326
return [
327327
[ [
328-
'en' => [ [ 'spam' ] ]
329-
] ],
328+
'en' => [ [ 'spam' ] ],
329+
] ],
330330
[ [
331-
'en' => [ [ 'foo', 'bar', 'baz' ] ]
332-
] ],
331+
'en' => [ [ 'foo', 'bar', 'baz' ] ],
332+
] ],
333333
[ [
334-
'en' => [ [ 'foo', 'bar' ], [ 'baz', 'spam' ] ]
335-
] ],
334+
'en' => [ [ 'foo', 'bar' ], [ 'baz', 'spam' ] ],
335+
] ],
336336
[ [
337-
'en' => [ [ 'foo', 'bar', 'baz' ] ],
338-
'de' => [ [ 'foobar' ], [ 'baz' ] ],
339-
] ],
337+
'en' => [ [ 'foo', 'bar', 'baz' ] ],
338+
'de' => [ [ 'foobar' ], [ 'baz' ] ],
339+
] ],
340340
// with duplicates
341341
[ [
342-
'en' => [ [ 'spam', 'ham', 'ham' ] ]
343-
] ],
342+
'en' => [ [ 'spam', 'ham', 'ham' ] ],
343+
] ],
344344
[ [
345-
'en' => [ [ 'foo', 'bar' ], [ 'bar', 'spam' ] ]
346-
] ],
345+
'en' => [ [ 'foo', 'bar' ], [ 'bar', 'spam' ] ],
346+
] ],
347347
];
348348
}
349349

0 commit comments

Comments
 (0)