data as $object) { $result .= (string) $object; } $bin = hex2bin('FF'); if (false === $bin) { throw new InvalidArgumentException('Unable to convert the data'); } $result .= $bin; return $result; } public function getNormalizedData(bool $ignoreTags = false): array { return array_map(function (CBORObject $item) use ($ignoreTags) { return $item->getNormalizedData($ignoreTags); }, $this->data); } public function add(CBORObject $item): void { $this->data[] = $item; } public function count(): int { return count($this->data); } public function getIterator(): Iterator { return new ArrayIterator($this->data); } }