TextDirection

Forced paragraph direction accepted by Bidi.

Table of contents

Namespace: Com\Tecnick\Unicode

enum TextDirection: string

Source: src/TextDirection.php:36

Forced paragraph direction accepted by Bidi. The backing value is the normalized direction: ’’ (auto detection), ‘R’ (force right-to-left) or ‘L’ (force left-to-right).

Cases

  • Auto = ''
  • Rtl = 'R'
  • Ltr = 'L'

Methods

fromLoose()

Resolve a loose forced-direction value to the matching enum case.

Accepts an enum instance, returned unchanged, or a string: the empty string means auto, otherwise the first character (case-insensitive) selects the direction and anything that is not R or L falls back to auto (never throws).

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

Parameters:

  • $value (string|self): Forced direction identifier or enum case.

Returns: self

Source: src/TextDirection.php:53