CoreFiles by mySites.guru
AbstractCBORObject.php32 lines, 605 bytes, from Joomla_5.0.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.4.0-alpha4
md5
bf65e58be47fd53a83b578139fdd98a1
sha1
b49cdb0929fc9567d95677f4de00fb8a7085ed30
sha256
8ea23482670f4250c8c0dcc2ec29af121982a5b13fde39bfd6c9230260fd4973
<?php

declare(strict_types=1);

namespace CBOR;

use function chr;
use Stringable;

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 22 releases, Joomla 5.0.0-alpha1 to 5.1.0-alpha4. See them all, or every version of this file.