CoreFiles by mySites.guru
AbstractCBORObject.php31 lines, 577 bytes, from Joomla_6.1.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 6.1.0-alpha1
md5
824a5a2b201ad79f1315bf791c9a3919
sha1
93dc173b400ea8d5a2bab9aa6c1725e310fb4fce
sha256
581292b78385f6576969ce02fc940cd3bc1efeb0ebefbb7434e8fc58be581cf5
<?php

declare(strict_types=1);

namespace CBOR;

use function chr;

abstract class AbstractCBORObject implements CBORObject
{
    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 32 releases, Joomla 6.1.0-alpha2 to 6.3.0-alpha1. See them all, or every version of this file.