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