Skip to content

Commit

Permalink
Release 2.6.0 (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiemowmde authored and manicki committed Sep 18, 2017
1 parent 1c11d9f commit b1ac697
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 24 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ Wikibase Internal Serialization has been written by [Jeroen De Dauw]

## Release notes

### 2.6.0 (2017-09-18)

* Added compatibility with DataValues Common 0.4, Number 0.9, and Time 0.8

### 2.5.0 (2017-08-30)

* Added compatibility with DataValues Geo 2.x
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.5.x-dev"
"dev-master": "2.6.x-dev"
}
},
"scripts": {
Expand Down
6 changes: 2 additions & 4 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?xml version="1.0"?>
<ruleset name="WikibaseInternalSerialization">
<rule ref="vendor/wikibase/wikibase-codesniffer/Wikibase">
<rule ref="./vendor/wikibase/wikibase-codesniffer/Wikibase">
<exclude name="Generic.Arrays.DisallowLongArraySyntax" />
<exclude name="MediaWiki.ControlStructures.IfElseStructure" />
<exclude name="Squiz.ControlStructures.ControlSignature" />
</rule>

<rule ref="Generic.CodeAnalysis" />
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="117" />
<property name="lineLimit" value="114" />
</properties>
</rule>

Expand Down
4 changes: 2 additions & 2 deletions phpmd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</rule>
<rule ref="rulesets/codesize.xml/TooManyMethods">
<properties>
<property name="maxmethods" value="20" />
<property name="maxmethods" value="11" />
</properties>
</rule>

Expand All @@ -22,7 +22,7 @@
</rule>
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
<properties>
<property name="minimum" value="14" />
<property name="minimum" value="13" />
</properties>
</rule>

Expand Down
12 changes: 4 additions & 8 deletions src/Deserializers/LegacyEntityIdDeserializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ public function __construct( EntityIdParser $idParser ) {
public function deserialize( $serialization ) {
if ( is_string( $serialization ) ) {
return $this->getParsedId( $serialization );
}
elseif ( $this->isLegacyFormat( $serialization ) ) {
} elseif ( $this->isLegacyFormat( $serialization ) ) {
return $this->getIdFromLegacyFormat( $serialization );
}
else {
} else {
throw new DeserializationException( 'Entity id format not recognized' );
}
}
Expand All @@ -51,17 +49,15 @@ private function isLegacyFormat( $serialization ) {
private function getParsedId( $serialization ) {
try {
return $this->idParser->parse( $serialization );
}
catch ( EntityIdParsingException $ex ) {
} catch ( EntityIdParsingException $ex ) {
throw new DeserializationException( $ex->getMessage(), $ex );
}
}

private function getIdFromLegacyFormat( array $serialization ) {
try {
return LegacyIdInterpreter::newIdFromTypeAndNumber( $serialization[0], $serialization[1] );
}
catch ( InvalidArgumentException $ex ) {
} catch ( InvalidArgumentException $ex ) {
throw new DeserializationException( $ex->getMessage(), $ex );
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/Deserializers/LegacyFingerprintDeserializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ public function deserialize( $serialization ) {
$this->getDescriptions( $serialization ),
$this->getAliases( $serialization )
);
}
catch ( InvalidArgumentException $ex ) {
} catch ( InvalidArgumentException $ex ) {
throw new DeserializationException(
'Could not deserialize fingerprint: ' . $ex->getMessage(),
$ex
Expand Down
6 changes: 2 additions & 4 deletions src/Deserializers/LegacySiteLinkListDeserializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ private function getDeserialized( array $siteLinkArray ) {
private function newSiteLinkFromSerialization( $siteId, $siteLinkData ) {
try {
return $this->tryNewSiteLinkFromSerialization( $siteId, $siteLinkData );
}
catch ( InvalidArgumentException $ex ) {
} catch ( InvalidArgumentException $ex ) {
throw new DeserializationException( $ex->getMessage(), $ex );
}
}
Expand All @@ -106,8 +105,7 @@ private function tryNewSiteLinkFromSerialization( $siteId, $siteLinkData ) {
if ( is_array( $siteLinkData ) ) {
$pageName = $siteLinkData['name'];
$badges = $this->getDeserializedBadges( $siteLinkData['badges'] );
}
else {
} else {
$pageName = $siteLinkData;
$badges = array();
}
Expand Down
3 changes: 1 addition & 2 deletions src/Deserializers/LegacySnakDeserializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ private function assertStructureIsValid( $serialization ) {

if ( $serialization[0] === 'value' ) {
$this->assertIsValueSnak( $serialization );
}
else {
} else {
$this->assertIsNonValueSnak( $serialization );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class StatementDeserializerTest extends \PHPUnit_Framework_TestCase {
private $currentSerializer;

protected function setUp() {
$this->deserializer = TestFactoryBuilder::newDeserializerFactoryWithDataValueSupport()->newStatementDeserializer();
$this->deserializer = TestFactoryBuilder::newDeserializerFactoryWithDataValueSupport()
->newStatementDeserializer();
$this->currentSerializer = TestFactoryBuilder::newSerializerFactory()->newStatementSerializer();
}

Expand Down

0 comments on commit b1ac697

Please sign in to comment.