# woocommerce-pos/1.10.19/vendor_prefixed/chillerlan/php-qrcode/src/Decoder/DecoderResult.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.19. 91 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.19/code/vendor_prefixed/chillerlan/php-qrcode/src/Decoder/DecoderResult.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.19/raw/vendor_prefixed/chillerlan/php-qrcode/src/Decoder/DecoderResult.php
- Modified: 2026-06-09T13:55:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.19/code/vendor_prefixed/chillerlan/php-qrcode/src/Decoder/DecoderResult.php#L10-L20`.

```php
<?php

/**
 * Class DecoderResult
 *
 * @created      17.01.2021
 * @author       ZXing Authors
 * @author       Smiley <smiley@chillerlan.net>
 * @copyright    2021 Smiley
 * @license      Apache-2.0
 */
namespace WCPOS\Vendor\chillerlan\QRCode\Decoder;

use WCPOS\Vendor\chillerlan\QRCode\Common\BitBuffer;
use WCPOS\Vendor\chillerlan\QRCode\Common\EccLevel;
use WCPOS\Vendor\chillerlan\QRCode\Common\MaskPattern;
use WCPOS\Vendor\chillerlan\QRCode\Common\Version;
use WCPOS\Vendor\chillerlan\QRCode\Data\QRMatrix;
use function property_exists;
/**
 * Encapsulates the result of decoding a matrix of bits. This typically
 * applies to 2D barcode formats. For now, it contains the raw bytes obtained
 * as well as a String interpretation of those bytes, if applicable.
 *
 * @property \chillerlan\QRCode\Common\BitBuffer         $rawBytes
 * @property string                                      $data
 * @property \chillerlan\QRCode\Common\Version           $version
 * @property \chillerlan\QRCode\Common\EccLevel          $eccLevel
 * @property \chillerlan\QRCode\Common\MaskPattern       $maskPattern
 * @property int                                         $structuredAppendParity
 * @property int                                         $structuredAppendSequence
 * @property \chillerlan\QRCode\Detector\FinderPattern[] $finderPatterns
 */
final class DecoderResult
{
    private BitBuffer $rawBytes;
    private Version $version;
    private EccLevel $eccLevel;
    private MaskPattern $maskPattern;
    private string $data = '';
    private int $structuredAppendParity = -1;
    private int $structuredAppendSequence = -1;
    /** @var \chillerlan\QRCode\Detector\FinderPattern[] */
    private array $finderPatterns = [];
    /**
     * DecoderResult constructor.
     */
    public function __construct(?iterable $properties = null)
    {
        if ($properties !== null) {
            foreach ($properties as $property => $value) {
                if (!property_exists($this, $property)) {
                    continue;
                }
                $this->{$property} = $value;
            }
        }
    }
    /**
     * @return mixed|null
     */
    public function __get(string $property)
    {
        if (property_exists($this, $property)) {
            return $this->{$property};
        }
        return null;
    }
    /**
     *
     */
    public function __toString() : string
    {
        return $this->data;
    }
    /**
     *
     */
    public function hasStructuredAppend() : bool
    {
        return $this->structuredAppendParity >= 0 && $this->structuredAppendSequence >= 0;
    }
    /**
     * Returns a QRMatrix instance with the settings and data of the reader result
     */
    public function getQRMatrix() : QRMatrix
    {
        return (new QRMatrix($this->version, $this->eccLevel))->initFunctionalPatterns()->writeCodewords($this->rawBytes)->setFormatInfo($this->maskPattern)->mask($this->maskPattern);
    }
}

```
