QrEccLevel

Backed enum for the QR Code error correction level.

Table of contents

Namespace: Com\Tecnick\Barcode\Type\Square\QrCode

enum QrEccLevel: string

Source: src/Type/Square/QrCode/QrEccLevel.php:35

Backed enum for the QR Code error correction level. The backing value of each case is the letter used as a key of Data::ECC_LEVELS.

Cases

  • L = 'L': Low (7%).
  • M = 'M': Medium (15%).
  • Q = 'Q': Quartile (25%).
  • H = 'H': High (30%).

Methods

fromLoose()

Resolve a loose ECC level value to the matching enum case.

Accepts the canonical letter or an enum instance (returned unchanged). Unknown values fall back to L, matching the lenient behavior of QrCode.

public static fromLoose(string|self $value): self

Parameters:

  • $value (string|self): ECC level letter or enum case.

Returns: self

Source: src/Type/Square/QrCode/QrEccLevel.php:57