@throws QrPaymentException

@return string
326993
public function getXzBinary()
    {
        if (is_null($this->xzPath)) {
            exec('which xz', $output, $return);
            if ($return !== 0) {
                throw new QrPaymentException("'xz' binary not found in PATH, specify it using setXzBinary()", QrPaymentException::ERR_MISSING_XZ);
            }
            if (!isset($output[0])) {
                throw new QrPaymentException("'xz' binary not found in PATH, specify it using setXzBinary()", QrPaymentException::ERR_MISSING_XZ);
            }
            $this->xzPath = $output[0];
        }
        if (!file_exists($this->xzPath)) {
            throw new QrPaymentException("The path '{$this->xzPath}' to 'xz' binary is invalid", QrPaymentException::ERR_MISSING_XZ);
        }

        return $this->xzPath;
    }
293242
public function getRawUserQueryIsEmptyString()
    {
        $path = $this->prefixWithNamespace('q');
        $query = $this->argumentsAccessor->get($path, null);

        if ($query === null) {
            return false;
        }

        if (trim($query) === '') {
            return true;
        }

        return false;
    }
740384
public function getContent()
    {
        $content = '';

        switch ($this->_alignment) {
            case self::TEXT_ALIGN_RIGHT:
                $content .= '\qr ';
                break;

            case self::TEXT_ALIGN_CENTER:
                $content .= '\qc ';
                break;

            case self::TEXT_ALIGN_JUSTIFY:
                $content .= '\qj ';
                break;

            default:
                $content .= '\ql ';
                break;
        }

        if ($this->_indentFirstLine != 0) {
            $content .= '\fi' . PHPRtfLite_Unit::getUnitInTwips($this->_indentFirstLine) . ' ';
        }

        if ($this->_indentLeft > 0) {
            $content .= '\li' . PHPRtfLite_Unit::getUnitInTwips($this->_indentLeft) . ' ';
        }

        if ($this->_indentRight > 0) {
            $content .= '\ri' . PHPRtfLite_Unit::getUnitInTwips($this->_indentRight) .' ';
        }

        if ($this->_spaceBefore > 0) {
            $content .= '\sb' . $this->_spaceBefore.' ';
        }

        if ($this->_spaceAfter > 0) {
            $content .= '\sa' . $this->_spaceAfter.' ';
        }

        if ($this->_spaceBetweenLines > 0) {
            $content .= '\sl' . $this->_spaceBetweenLines.' ';
        }

        if ($this->_border) {
            $content .= $this->_border->getContent('\\');
        }

        if ($this->_shading > 0) {
            $content .= '\shading' . $this->_shading . ' ';
        }

        if ($this->_backgroundColor && $this->_colorTable) {
            $colorIndex = $this->_colorTable->getColorIndex($this->_backgroundColor);
            if ($colorIndex !== false) {
                $content .= '\cbpat' . $colorIndex . ' ';
            }
        }

        return $content;
    }
1254632
public function toNQuads()
    {
        $string = '"'.$this->encodeStringLitralForNQuads($this->getValue()).'"';

        if ($this->getLanguage() !== null) {
            $string .= '@'.$this->getLanguage();
        } elseif ($this->getDatatype() !== null) {
            $string .= '^^<'.$this->getDatatype().'>';
        }

        return $string;
    }
921379
public function getIdForQName( $qname )
	{
		if ( ! $qname instanceof QName )
		{
			$qname = qname( $qname, $this->getDocumentNamespaces() );
		}

		if ( ! $qname )
		{
			throw new Exception("Unable to resolve the QName '$qname'");
		}

		$taxonomy = $this->getTaxonomyForNamespace( $qname->namespaceURI );
		$taxonomy_element = $taxonomy->getElementByName( $qname->localName );
		return "{$taxonomy->getTaxonomyXSD()}#{$taxonomy_element['id']}";
	}
11279
public static function fromQRCode($qrCodeString)
    {
        $paramsMap = [
            't'  => 'date',
            's'  => 'sum',
            'fn' => 'fiscalNumber',
            'i'  => 'fiscalDocument',
            'fp' => 'fiscalSign',
            'n'  => 'operation',
        ];

        $normalizedParams = array_fill_keys(array_values($paramsMap), null);

        parse_str($qrCodeString, $qrCodeParams);

        foreach ($paramsMap as $qrField => $normalizedField) {
            if (array_key_exists($qrField, $qrCodeParams)) {
                $normalizedParams[$normalizedField] = $qrCodeParams[$qrField];
            }
        }

        $normalizedParams['sum'] = self::rub2Kopeck($normalizedParams['sum']);

        return $normalizedParams;
    }
120781
public function getName()
	{
		if (empty($this->_name))
		{
			$this->_name = \App::get('request')->getCmd('controller');

			if (!$this->_name)
			{
				$r = null;

				if (!preg_match('/View((view)*(.*(view)?.*))$/i', get_class($this), $r))
				{
					throw new Exception('Cannot get or parse view class name.', 500);
				}

				if (strpos($r[3], 'view'))
				{
					throw new Exception('Classname contains the substring "view" which causes problems when extracting the classname.', 500);
				}

				$this->_name = strtolower($r[3]);
			}
		}
		return $this->_name;
	}
75452
private function tpl(): string
    {
        if (interface_exists($this->type)) {
            return 'Return value of %s must implement interface %s, %s returned';
        }

        if (class_exists($this->type)) {
            return 'Return value of %s must be an instance of %s, %s returned';
        }

        if ($this->type == 'callable') {
            return 'Return value of %s must be %s, %s returned';
        }

        return 'Return value of %s must be of the type %s, %s returned';
    }
844066
public function createQRCode()
    {
        $folder = $this->fileFolder();
        $relativeFilePath = "/{$folder->Filename}{$this->TicketCode}.png";
        $absoluteFilePath = Director::baseFolder() . $relativeFilePath;

        if (!$image = Image::get()->find('Filename', $relativeFilePath)) {
            // Generate the QR code
            $renderer = new BaconQrCode\Renderer\Image\Png();
            $renderer->setHeight(256);
            $renderer->setWidth(256);
            $writer = new BaconQrCode\Writer($renderer);
            if (self::config()->get('qr_as_link')) {
                $writer->writeFile($this->getCheckInLink(), $absoluteFilePath);
            } else {
                $writer->writeFile($this->TicketCode, $absoluteFilePath);
            }

            // Store the image in an image object
            $image = Image::create();
            $image->ParentID = $folder->ID;
            $image->OwnerID = (Member::currentUser()) ? Member::currentUser()->ID : 0;
            $image->Title = $this->TicketCode;
            $image->setFilename($relativeFilePath);
            $image->write();

            // Attach the QR code to the Attendee
            $this->TicketQRCodeID = $image->ID;
            $this->write();
        }

        return $image;
    }
1159216
public function getFullMessage(): string {
        $paras = [];

        if (!empty($this->getMainMessage())) {
            $paras[] = $this->getMainMessage();
        } elseif ($this->getErrorCount() === 0) {
            return '';
        }

        if (isset($this->errors[''])) {
            $paras[] = $this->formatErrorList('', $this->errors['']);
        }

        foreach ($this->errors as $field => $errors) {
            if ($field === '') {
                continue;
            }
            $paras[] = $this->formatErrorList($field, $errors);
        }

        $result = implode("\n\n", $paras);
        return $result;
    }
154053
protected function getPtWebQQ()
    {
        $request = new Request\GetPtWebQQRequest();
        $request->setUri($this->certificationUrl);
        $this->sendRequest($request);
        foreach ($this->getCookies() as $cookie) {
            if (0 === strcasecmp($cookie->getName(), 'ptwebqq')) {
                return $cookie->getValue();
            }
        }
        throw new RuntimeException('Can not find parameter [ptwebqq]');
    }
1287377
public function getQrImage(bool $setPngHeader = false): QrCode
    {
        if (!class_exists("Endroid\QrCode\QrCode")) {
            throw new QrPaymentException("Error: library endroid/qr-code is not loaded.", QrPaymentException::ERR_MISSING_LIBRARY);
        }

        if ($setPngHeader) {
            header("Content-type: image/png");
        }

        return new QrCode($this->getQrString());
    }
1006637
public function getURLQuery()
    {
        $qstr = '?';

        $params = $this->getParametersArray();

        $paramCount = count($params);
        $i = 0;
        foreach ($params as $key => $value) {
            if ($value === null) {
                continue;
            }

            $qstr .= $key . '=' . rawurlencode($value);

            if ($i < $paramCount - 1) {
                $qstr .= '&';
            }

            $i++;
        }

        return $qstr;
    }
553597
public function summarise() {
        if (trim($this->text) != '') {
            $summariseplace =
                        get_string('summariseplace', 'qtype_ddimageortext', $this);
        } else {
            $summariseplace =
                    get_string('summariseplaceno', 'qtype_ddimageortext', $this->no);
        }
        return $summariseplace;
    }
268447
public function getName() : string
    {
        if (is_null($this->name)) {
            $this->name = $this->getFQCN();
        }
        return $this->name;
    }
1317144
public function getSendQuota()
    {
        $this->_action = 'GetSendQuota';
        $this->_method = 'GET';
        $this->_refreshDate();

        $this->_generateSignature();
        $res = $this->_request();
        if ($res['code'] == 200) {
            $result = $res['body']->GetSendQuotaResult;
            return array(
                'MaxSendRate' => (string) $result->Max24HourSend,
                'SentLast24Hours' => (string) $result->SentLast24Hours,
                'MaxSendRate' => (string) $result->MaxSendRate
            );
        } else {
            return new SimpleEmailServiceError((string) $res['body']->Error->Code);
        }
        throw new Exception(self::ERROR);
    }
1021845
public function getVariableQName()
	{
		// Use the cached name if there is one.
		if ( ! $this->qname )
		{
			if ( ! property_exists( $this, 'variable' ) ) return null;
			$this->qname = $qname = new QName( $this->variable['originalPrefix'], $this->variable['namespace'], $this->variable['name'] );
		}

		return $this->qname;
	}