original_string: public static function fromString(string $value)
      {
          $locale = preg_split('/-|_/', $value, 2);
          $language = null;
          $culture = null;
  
          if (isset($locale[0])) {
              $language = $locale[0];
          }
  
          if (isset($locale[1])) {
              $culture = $locale[1];
          }
  
          return new static($language, $culture);
      }
code: public static function fromString(string $value)
      {
          $locale = preg_split('/-|_/', $value, 2);
          $language = null;
          $culture = null;
  
          if (isset($locale[0])) {
              $language = $locale[0];
          }
  
          if (isset($locale[1])) {
              $culture = $locale[1];
          }
  
          return new static($language, $culture);
      }
code_tokens: public static function fromString ( string $ value ) { $ locale = preg_split ( '/-|_/' , $ value , 2 ) ; $ language = null ; $ culture = null ; if ( isset ( $ locale [ 0 ] ) ) { $ language = $ locale [ 0 ] ; } if ( isset ( $ locale [ 1 ] ) ) { $ culture = $ locale [ 1 ] ; } return new static ( $ language , $ culture ) ; }
docstring: Parses the given string and returns its Locale representation.
  
  @param string $value The value to parse.
  @return Locale The Locale representation of the given value or a null value.
docstring_tokens: Parses the given string and returns its Locale representation .