From 760d03620abe298c2d7a6d44e5b98d336279b13d Mon Sep 17 00:00:00 2001 From: Philip Gichuhi Date: Mon, 20 Jun 2022 17:29:08 +0300 Subject: [PATCH] Fix failing test --- serialization/php/json/src/JsonParseNode.php | 8 ++++---- .../php/json/src/JsonSerializationWriter.php | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/serialization/php/json/src/JsonParseNode.php b/serialization/php/json/src/JsonParseNode.php index b84d2a8166..5f6f26cbdc 100644 --- a/serialization/php/json/src/JsonParseNode.php +++ b/serialization/php/json/src/JsonParseNode.php @@ -105,12 +105,12 @@ public function getObjectValue(array $type): ?Parsable { } /** @var Parsable $result */ $result = $callableString($this); - if($this->onBeforeAssignFieldValues !== null) { - $this->onBeforeAssignFieldValues($result)(); + if($this->getOnBeforeAssignFieldValues() !== null) { + $this->getOnBeforeAssignFieldValues()($result); } $this->assignFieldValues($result); - if ($this->onAfterAssignFieldValues !== null){ - $this->onAfterAssignFieldValues($result)(); + if ($this->getOnAfterAssignFieldValues() !== null){ + $this->getOnAfterAssignFieldValues()($result); } return $result; } diff --git a/serialization/php/json/src/JsonSerializationWriter.php b/serialization/php/json/src/JsonSerializationWriter.php index 71c1e764e2..3b9fb461f2 100644 --- a/serialization/php/json/src/JsonSerializationWriter.php +++ b/serialization/php/json/src/JsonSerializationWriter.php @@ -158,19 +158,19 @@ public function writeObjectValue(?string $key, $value): void { if(!empty($key)) { $this->writePropertyName($key); } - if ($this->onBeforeObjectSerialization !== null) { - $this->onBeforeObjectSerialization($value)(); + if ($this->getOnBeforeObjectSerialization() !== null) { + $this->getOnBeforeObjectSerialization()($value); } $this->writer [] = '{'; - if ($this->onStartObjectSerialization !== null) { - $this->onStartObjectSerialization($value, $this)(); + if ($this->getOnStartObjectSerialization() !== null) { + $this->getOnStartObjectSerialization()($value, $this); } $value->serialize($this); if ($this->writer[count($this->writer) - 1] === ',') { array_pop($this->writer); } - if ($this->onAfterObjectSerialization !== null) { - $this->onAfterObjectSerialization($value)(); + if ($this->getOnAfterObjectSerialization() !== null) { + $this->getOnAfterObjectSerialization()($value); } $this->writer [] = '}'; }