Skip to content

Commit fab7bd9

Browse files
committed
Merge pull request #600 from wmde/entityIdInjection
Simplify ReferenceList::unserialize
2 parents 334665b + e85073e commit fab7bd9

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/Entity/EntityIdValue.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ protected function getNumericId() {
5252
*
5353
* @since 0.5
5454
*
55-
* @param string $value
55+
* @param string $serialized
5656
*
5757
* @throws IllegalValueException
5858
*/
59-
public function unserialize( $value ) {
60-
list( $entityType, $numericId ) = json_decode( $value );
59+
public function unserialize( $serialized ) {
60+
list( $entityType, $numericId ) = json_decode( $serialized );
6161

6262
try {
6363
$entityId = LegacyIdInterpreter::newIdFromTypeAndNumber( $entityType, $numericId );

src/Entity/ItemId.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ public function serialize() {
6363
/**
6464
* @see Serializable::unserialize
6565
*
66-
* @param string $value
66+
* @param string $serialized
6767
*/
68-
public function unserialize( $value ) {
69-
list( , $this->serialization ) = json_decode( $value );
68+
public function unserialize( $serialized ) {
69+
list( , $this->serialization ) = json_decode( $serialized );
7070
}
7171

7272
/**

src/Entity/PropertyId.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ public function serialize() {
6363
/**
6464
* @see Serializable::unserialize
6565
*
66-
* @param string $value
66+
* @param string $serialized
6767
*/
68-
public function unserialize( $value ) {
69-
list( , $this->serialization ) = json_decode( $value );
68+
public function unserialize( $serialized ) {
69+
list( , $this->serialization ) = json_decode( $serialized );
7070
}
7171

7272
/**

src/HashArray.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,10 @@ public function serialize() {
454454
/**
455455
* @see Serializable::unserialize
456456
*
457-
* @param string $serialization
457+
* @param string $serialized
458458
*/
459-
public function unserialize( $serialization ) {
460-
$serializationData = unserialize( $serialization );
459+
public function unserialize( $serialized ) {
460+
$serializationData = unserialize( $serialized );
461461

462462
foreach ( $serializationData['data'] as $offset => $value ) {
463463
// Just set the element, bypassing checks and offset resolving,

src/ReferenceList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ public function serialize() {
217217
*
218218
* @since 2.1
219219
*
220-
* @param string $data
220+
* @param string $serialized
221221
*/
222-
public function unserialize( $data ) {
223-
$this->__construct( unserialize( $data ) );
222+
public function unserialize( $serialized ) {
223+
$this->references = unserialize( $serialized );
224224
}
225225

226226
/**

0 commit comments

Comments
 (0)