/** * @param ProtocolNode $node */ protected function writeInternal($node) { $len = 1; if ($node->getAttributes() != null) { $len += count($node->getAttributes()) * 2; } if (count($node->getChildren()) > 0) { $len += 1; } if (strlen($node->getData()) > 0) { $len += 1; } $this->writeListStart($len); $this->writeString($node->getTag()); $this->writeAttributes($node->getAttributes()); if (strlen($node->getData()) > 0) { $this->writeBytes($node->getData()); } if ($node->getChildren()) { $this->writeListStart(count($node->getChildren())); foreach ($node->getChildren() as $child) { $this->writeInternal($child); } } }
/** * Process the challenge. * * * @param ProtocolNode $node * The node that contains the challenge. */ protected function processChallenge($node) { $this->challengeData = $node->getData(); }