public static function normalize($types) {
    $normalized_types = [];
    foreach ($types as $type) {
      switch ($type) {
        case 'boolean':
          $normalized_types[] = 'bool';
          break;
        case 'integer':
          $normalized_types[] = 'int';
          break;
        case 'double':
          $normalized_types[] = 'float';
          break;
        case 'callback':
          $normalized_types[] = 'callable';
          break;
        case 'scalar':
          $normalized_types[] = 'bool';
          $normalized_types[] = 'int';
          $normalized_types[] = 'float';
          $normalized_types[] = 'string';
          break;
        default:
          $normalized_types[] = $type;
          break;
      }
    }
    return $normalized_types;
  }