Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndiritu committed Jun 20, 2022
1 parent e0a15d9 commit 760d036
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions serialization/php/json/src/JsonParseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
12 changes: 6 additions & 6 deletions serialization/php/json/src/JsonSerializationWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [] = '}';
}
Expand Down

0 comments on commit 760d036

Please sign in to comment.