CoreFiles by mySites.guru
UnknownObject.php59 lines, 1,297 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
ea229293d330e723ab8f433516f79e10
sha1
00b88f32422418b950b0a49f37e99546ece73e2b
sha256
fcad4d3f4da0d2c5632cda10249ff5c4934b80f8802a1a42f570ee2c03b8321a
<?php
/*
 * This file is part of the PHPASN1 library.
 *
 * Copyright © Friedrich Große <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace FG\ASN1;

class UnknownObject extends ASNObject
{
    /** @var string */
    private $value;

    private $identifier;

    /**
     * @param string|int $identifier Either the first identifier octet as int or all identifier bytes as a string
     * @param int        $contentLength
     */
    public function __construct($identifier, $contentLength)
    {
        if (is_int($identifier)) {
            $identifier = chr($identifier);
        }

        $this->identifier = $identifier;
        $this->value = "Unparsable Object ({$contentLength} bytes)";
        $this->setContentLength($contentLength);
    }

    public function getContent()
    {
        return $this->value;
    }

    public function getType()
    {
        return ord($this->identifier[0]);
    }

    public function getIdentifier()
    {
        return $this->identifier;
    }

    protected function calculateContentLength()
    {
        return $this->getContentLength();
    }

    protected function getEncodedValue()
    {
        return '';
    }
}

The same content is in 137 releases, Joomla 4.0.0-beta to 5.0.0-beta2. See them all, or every version of this file.