private function leafToStdObject(ProcessableInterface $tree) { $result = new \StdClass(); $msgName = $tree->getName(); $result->{$msgName} = $tree->getValue(); return $result; }
public function buildContent(ProcessableInterface $message) { $content = '"' . $message->getName() . '":' . $this->buildBody($message); # entire message is surrounded by {} if (!$message->getParent()) { $content = '{' . $content . '}'; } return $content; }
private function leafToArray(ProcessableInterface $tree) { return [$tree->getName() => $tree->getValue()]; }