for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace MessagePack\Exception;
use MessagePack\MessagePackException;
use RuntimeException;
use function dechex;
final class UnknownByteHeader extends RuntimeException implements MessagePackException
{
/** @var mixed */
private $value;
public static function fromOffset(int $value, int $offset): self
$byte = dechex($value);
return new self(
$value,
"Can't decode data with byte-header 0x${byte} in position ${offset}"
);
}
public function getValue()
return $this->value;
private function __construct($value, string $message)
parent::__construct($message);
$this->value = $value;