Skip to content

Commit 0683be3

Browse files
authored
Merge pull request #750 from wmde/cleanDocs
Clarify documentation of …::newFromArray
2 parents c81b042 + 1d81943 commit 0683be3

2 files changed

Lines changed: 10 additions & 21 deletions

File tree

src/Entity/EntityIdValue.php

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public function serialize() {
3939
/**
4040
* @see Serializable::unserialize
4141
*
42-
* @since 0.5
43-
*
4442
* @param string $serialized
4543
*
4644
* @throws IllegalValueException
@@ -67,8 +65,6 @@ public function unserialize( $serialized ) {
6765
/**
6866
* @see DataValue::getType
6967
*
70-
* @since 0.5
71-
*
7268
* @return string
7369
*/
7470
public static function getType() {
@@ -78,8 +74,6 @@ public static function getType() {
7874
/**
7975
* @see DataValue::getSortKey
8076
*
81-
* @since 0.5
82-
*
8377
* @return string|float|int
8478
*/
8579
public function getSortKey() {
@@ -89,17 +83,13 @@ public function getSortKey() {
8983
/**
9084
* @see DataValue::getValue
9185
*
92-
* @since 0.5
93-
*
9486
* @return self
9587
*/
9688
public function getValue() {
9789
return $this;
9890
}
9991

10092
/**
101-
* @since 0.5
102-
*
10393
* @return EntityId
10494
*/
10595
public function getEntityId() {
@@ -109,8 +99,6 @@ public function getEntityId() {
10999
/**
110100
* @see DataValue::getArrayValue
111101
*
112-
* @since 0.5
113-
*
114102
* @return array
115103
*/
116104
public function getArrayValue() {
@@ -127,15 +115,19 @@ public function getArrayValue() {
127115
}
128116

129117
/**
130-
* Constructs a new instance of the DataValue from the provided data.
131-
* This can round-trip with
132-
* @see getArrayValue
118+
* Constructs a new instance from the provided data. Required for @see DataValueDeserializer.
119+
* This is expected to round-trip with @see getArrayValue.
133120
*
134-
* @since 0.5
121+
* @deprecated since 7.1. Static DataValue::newFromArray constructors like this are
122+
* underspecified (not in the DataValue interface), and misleadingly named (should be named
123+
* newFromArrayValue). Instead, use DataValue builder callbacks in @see DataValueDeserializer.
135124
*
136-
* @param mixed $data
125+
* @param mixed $data Warning! Even if this is expected to be a value as returned by
126+
* @see getArrayValue, callers of this specific newFromArray implementation can not guarantee
127+
* this. This is not even guaranteed to be an array!
137128
*
138-
* @throws IllegalValueException
129+
* @throws IllegalValueException if $data is not in the expected format. Subclasses of
130+
* InvalidArgumentException are expected and properly handled by @see DataValueDeserializer.
139131
* @return self
140132
*/
141133
public static function newFromArray( $data ) {

src/Statement/StatementListHolder.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
*/
1515
interface StatementListHolder extends StatementListProvider {
1616

17-
/**
18-
* @param StatementList $statements
19-
*/
2017
public function setStatements( StatementList $statements );
2118

2219
}

0 commit comments

Comments
 (0)