code: private function sortJoinedTypes($types)
      {
          $types = array_filter(
              Preg::split('/([^|<]+(?:<.*>)?)/', $types, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY),
              static function ($value) {
                  return '|' !== $value;
              }
          );
  
          return implode('|', $this->sortTypes($types));
      }
docs: @param string $types
  
  @return string