Set the Paytrail API version.

@param int $apiVersion The API version.

@throws \Paytrail\Exception\ApiVersionNotSupported
171438
public function setApiVersion($apiVersion)
    {
        if ( ! in_array($apiVersion, self::$supportedApiVersions)) {
            throw new ApiVersionNotSupported(sprintf('API version %d is not supported.', $apiVersion));
        }
        $this->apiVersion = $apiVersion;
    }
578596
public function withProtocolVersion($version)
    {
        if (is_numeric($version)) {
            $version = number_format((float)$version, $version < 2 ? 1 : 0, '.', '');
        }
        
        $this->assertProtocolVersion($version);
        
        $request = $this->copy();
        $request->protocolVersion = $version;
        
        return $request;
    }
412349
def set_stripe_api_version(version=None, validate=True):
	
	version = version or get_stripe_api_version()

	if validate:
		valid = validate_stripe_api_version(version)
		if not valid:
			raise ValueError("Bad stripe API version: {}".format(version))

	stripe.api_version = version
743614
public void setVersion(int version) throws HandlerException {
        if (version < 1 || version > ISO9660Constants.MAX_FILE_VERSION) {
            throw new HandlerException("Invalid file version: " + version);
        }
        this.version = version;

        if (parent != null) {
            parent.forceSort();
        }
    }
1283294
public static function SetVersion($number)
    {
        self::CheckBackend();

        $number = trim($number);

        self::$backend->Set("version", $number);
    }
200984
public function setVersion($version)
    {
        if (null !== $version) {
            Assert::string($version, 'The application version must be a string. Got: %s');
            Assert::notEmpty($version, 'The application version must not be empty.');
        }

        $this->version = $version;

        return $this;
    }
158083
function setApiVersion($version, $multicall = false)
    {
        if (!is_string($version)) {
            throw new InvalidArgumentException('version = ' . print_r($version, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($version), $multicall);
    }
27314
public function setRemoteVersionUrl(string $remoteVerUrl): void
    {
        if (empty($remoteVerUrl)) {
            throw new Exception('the parameter $remoteVerUrl can not be empty', Exception::VERSION_URL_MISSING);
        }

        $this->remoteVersionUrl = $remoteVerUrl;
    }
1160251
public function setToolVersion($toolVersion)
    {
        if (Format::isString256($toolVersion) === true) {
            $this->toolVersion = $toolVersion;
        } else {
            $msg = "The toolVersion argument must be a string with at most 256 characters.";
            throw new InvalidArgumentException($msg);
        }
    }
1045759
public function dispatch(Request $request, $version)
    {
        if (! isset($this->routes[$version])) {
            throw new UnknownVersionException();
        }

        $this->removeMiddlewareFromApp();

        $routeCollector = $this->mergeOldRoutes($version);
        $dispatcher = \call_user_func($this->dispatcherResolver, $routeCollector);

        $this->app->setDispatcher($dispatcher);

        $this->normalizeRequestUri($request);

        return $this->app->dispatch($request);
    }
727099
protected function setVersion($version)
    {
        try {
            // Prepare
            $currentVersion = $this->config['version'];
            // Replace in config file
            $this->replaceInFile($currentVersion, $version, $this->configFilename);
            // Replace in package.json
            $packageJson = json_decode(file_get_contents($this->rootPath.'/package.json'));
            $this->replaceInFile(
                '"version": "'.$packageJson->version.'"',
                '"version": "'.$version.'"',
                $this->rootPath.'/package.json'
            );
            // Replace in project
            $filename = $this->config['type'] === 'theme'
                ? $this->rootPath.'/style.css'
                : $this->rootPath.'/plugin.php';
            preg_match(
                '/[Vv]ersion\:[|\s][0-9\.vV]+/',
                file_get_contents($filename),
                $matches
            );
            if (count($matches) > 0)
                $this->replaceInFile(
                    $matches[0],
                    'Version: '.$version,
                    $filename
                );
            // Print end
            $this->_print('Version updated!');
            $this->_lineBreak();
        } catch (Exception $e) {
            file_put_contents(
                $this->rootPath.'/error_log',
                $e->getMessage()
            );
            throw new NoticeException('Command "'.$this->key.'": Fatal error ocurred.');
        }
    }
203608
public function setVersion($version)
    {
        Assert::string($version, 'The module file version must be a string. Got: %s');
        Assert::regex($version, '~^\d\.\d$~', 'The module file version must have the format "<digit>.<digit>". Got: %s</digit>');

        $this->version = $version;
    }
969052
public function setValue($version = 0.0)
    {
        $this->version = $version;
        $major = floor($version);
        $minor = ($version - $major) * 100;
        $strValue = sprintf('%02.0f%02.0f', $major, $minor);
        $this->components = strlen($strValue);
        $this->bytes = $strValue;
    }
76194
public function httpVersion($version) {

		if(false === defined($version)) {
			return trigger_error(sprintf('Argument 1 passed to %s() is not a valid HTTP protocol version', __METHOD__), E_USER_ERROR);
		}

		$this -> options[CURLOPT_HTTP_VERSION] = constant($version);

		return $this;
	}
1176472
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;
  }
446195
public function setHTTPVersion($version = self::HTTP_1)
	{
		if ($version == self::HTTP_0 || $version == self::HTTP_1) {
			$this->httpVersion = $version;
		} else {
			throw new RuntimeException('Invalid HTTP version setted.');
		}
		
		return $this;
	}
621581
public function supportsBelow($phpVersion)
    {
        if (
            !is_null(PHP_CodeSniffer::getConfigData('testVersion'))
            &&
            version_compare(PHP_CodeSniffer::getConfigData('testVersion'), $phpVersion) <= 0
        ) {
            return true;
        } else {
            return false;
        }
    }