Beispiel #1
0
 /**
  * @param string $string
  * @param TransformationFormat $encoding
  * @return static
  */
 public static function fromEncodedString($string, TransformationFormat $encoding)
 {
     $characters = StringUtility::split($string, $encoding);
     $mapper = function ($character) use($encoding) {
         return Codepoint::fromEncodedCharacter($character, $encoding);
     };
     return static::fromArray(array_map($mapper, $characters));
 }
Beispiel #2
0
 /**
  * @param string $start
  * @param string $end
  * @param TransformationFormat $encoding
  * @return self
  */
 public static function betweenEncodedCharacters($start, $end, TransformationFormat $encoding)
 {
     return self::between(Codepoint::fromEncodedCharacter($start, $encoding), Codepoint::fromEncodedCharacter($end, $encoding));
 }