CoreFiles by mySites.guru
AbstractCBORObject.php32 lines, 605 bytes, from Joomla_5.4.0-beta1-Beta-Full_Package.zip
Raw History Compare with 5.3.0-beta3
md5
0af8b11ca142d40ffd6f85c7b8974aa1
sha1
aeeaa1546b5862aed184cc35ec9db0899adadb65
sha256
36a35223eefaa233b9f462db28b50fe7c817376c99f81c22e6fe25406aadaeb7
<?php

declare(strict_types=1);

namespace CBOR;

use Stringable;
use function chr;

abstract class AbstractCBORObject implements CBORObject, Stringable
{
    public function __construct(
        private int $majorType,
        protected int $additionalInformation
    ) {
    }

    public function __toString(): string
    {
        return chr($this->majorType << 5 | $this->additionalInformation);
    }

    public function getMajorType(): int
    {
        return $this->majorType;
    }

    public function getAdditionalInformation(): int
    {
        return $this->additionalInformation;
    }
}

The same content is in 104 releases, Joomla 5.1.0-beta1 to 6.1.0-alpha1. See them all, or every version of this file.