Skip to content

Commit adfa7a2

Browse files
committed
Make constructor signature of DerivedPropertyValueSnak match parent
1 parent 4e8281d commit adfa7a2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/Snak/DerivedPropertyValueSnak.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class DerivedPropertyValueSnak extends PropertyValueSnak {
3434
private $derivedDataValues = array();
3535

3636
/**
37-
* @param PropertyId $propertyId
37+
* @param PropertyId|EntityId|int $propertyId
3838
* @param DataValue $dataValue
3939
* @param DataValue[] $derivedDataValues
4040
*/
4141
public function __construct(
42-
PropertyId $propertyId,
42+
$propertyId,
4343
DataValue $dataValue,
4444
array $derivedDataValues
4545
) {
@@ -72,6 +72,7 @@ public function getDerivedDataValue( $key ) {
7272
if ( isset( $this->derivedDataValues[$key] ) ) {
7373
return $this->derivedDataValues[$key];
7474
}
75+
7576
return null;
7677
}
7778

tests/unit/Snak/DerivedPropertyValueSnakTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ public function validConstructorArgumentsProvider() {
4242
new StringValue( 'bc' ),
4343
array( 'foo' => new StringValue( 'foo' ), 'bar' => new StringValue( 'bar' ) ),
4444
),
45+
'numeric id' => array(
46+
42,
47+
new StringValue( 'foo' ),
48+
array()
49+
)
4550
);
4651
}
4752

0 commit comments

Comments
 (0)