public static function setSpecVersion($version)
  {
    if (!in_array($version, array('1.1', '1.2'))) {
      throw new InvalidArgumentException(sprintf('Version %s of the YAML specifications is not supported', $version));
    }

    self::$spec = $version;
  }