HanXinEccLevel

Backed enum for the Han Xin Code error correction level.

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

enum HanXinEccLevel: string

Source: src/Type/Square/HanXin/HanXinEccLevel.php:34

Backed enum for the Han Xin Code error correction level.

Cases

  • L1 = 'L1': Recovers 8% of the codewords.
  • L2 = 'L2': Recovers 15% of the codewords.
  • L3 = 'L3': Recovers 23% of the codewords.
  • L4 = 'L4': Recovers 30% of the codewords.

Methods

fromLoose()

Resolve a loose error correction level value to the matching enum case.

Accepts the canonical token, the level number alone or an enum instance (returned unchanged). Unknown values fall back to L1.

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

Parameters:

  • $value (string|self): Error correction level token or enum case.

Returns: self

Source: src/Type/Square/HanXin/HanXinEccLevel.php:56

getLevel()

Returns the level number, from 1 to 4.

public getLevel(): int

Returns: int

Source: src/Type/Square/HanXin/HanXinEccLevel.php:68