BidiClass

Strong, weak and neutral bidirectional character classes.

Namespace: Com\Tecnick\Unicode\Data

enum BidiClass: string

Source: src/BidiClass.php:37

Strong, weak and neutral bidirectional character classes. The backing value of each case is the class abbreviation used as key of Type::STRONG, Type::WEAK and Type::NEUTRAL. The explicit formatting codes (LRE, LRO, RLE, RLO, PDF, LRI, RLI, FSI, PDI) are not part of this set.

Cases

  • L = 'L'
  • R = 'R'
  • AL = 'AL'
  • EN = 'EN'
  • ES = 'ES'
  • ET = 'ET'
  • AN = 'AN'
  • CS = 'CS'
  • NSM = 'NSM'
  • BN = 'BN'
  • B = 'B'
  • S = 'S'
  • WS = 'WS'
  • ON = 'ON'

Methods

fromLoose()

Get the enum case of a bidirectional class abbreviation.

An enum case is returned unchanged. Unknown values throw a \ValueError.

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

Parameters:

  • $value (string|self): Bidirectional class abbreviation or enum case.

Returns: self

Source: src/BidiClass.php:77

isNeutral()

True for a neutral type (B, S, WS, ON).

public isNeutral(): bool

Returns: bool

Source: src/BidiClass.php:105

isStrong()

True for a strong type (L, R, AL).

public isStrong(): bool

Returns: bool

Source: src/BidiClass.php:89

isWeak()

True for a weak type (EN, ES, ET, AN, CS, NSM, BN).

public isWeak(): bool

Returns: bool

Source: src/BidiClass.php:97