src/includes/classes/Core/Utils/Uuid64.php
public function validateTypeId(int $type_id, int $expecting_type_id = null): int
    {
        if ($type_id < 0 || $type_id > 255) {
            throw $this->c::issue('Type ID out of range.');
        } elseif (isset($expecting_type_id) && $type_id !== $expecting_type_id) {
            throw $this->c::issue(sprintf('Type ID mismatch: `%1$s`/`%2$s`.', $type_id, $expecting_type_id));
        }
        return $type_id;
    }
public function validateTypeId(int $type_id, int $expecting_type_id = null): int
    {
        if ($type_id < 0 || $type_id > 255) {
            throw $this->c::issue('Type ID out of range.');
        } elseif (isset($expecting_type_id) && $type_id !== $expecting_type_id) {
            throw $this->c::issue(sprintf('Type ID mismatch: `%1$s`/`%2$s`.', $type_id, $expecting_type_id));
        }
        return $type_id;
    }
Validate type ID.

@since 150424 Initial release.

@param int      $type_id           Input type ID (8 bits unsigned max `255`).
@param int|null $expecting_type_id Expected type ID.

@return int Validated type ID (8 bits unsigned max `255`).