Set the current version.

@param int $version
765878
public function setCurrentVersion($version)
    {
        $version = min($this->getMaxVersion(), $version);
        $version = max($version, 0);
        $this->_getVersion()->version = $version;
        $this->_getVersion()->saveEntity();
    }
1110124
public function tag( $version ) {

		$this->versionSet( $version );

		$this->taskGitStack()
		     ->stopOnFail()
		     ->add( 'laps.php' )
		     ->commit( "Updated header version to {$version}" )
		     ->tag( $version )
		     ->run();
	}
253399
public function setVersion($version)
    {
        if ($version == self::VERSION_3 || $version == self::VERSION_3_1_1) {
            $this->version = $version;
        } else {
            throw new Exception('Invalid version');
        }
    }
57710
public function set(string $version): VersionInterface
    {
        $matches = [];
        $numbers = [];

        if (preg_match($this->regex, $version, $matches)) {
            $numbers = $this->mapMatches($matches);
        }

        if (empty($numbers)) {
            return new Version('0');
        }

        $major = (array_key_exists('major', $numbers) ? $numbers['major'] : '0');
        $minor = (array_key_exists('minor', $numbers) ? $numbers['minor'] : '0');

        if (array_key_exists('micro', $numbers)) {
            $micro      = $numbers['micro'];
            $patch      = (array_key_exists('patch', $numbers) ? $numbers['patch'] : null);
            $micropatch = (array_key_exists('micropatch', $numbers) ? $numbers['micropatch'] : null);
        } else {
            $micro      = '0';
            $patch      = null;
            $micropatch = null;
        }

        $stability = (array_key_exists('stability', $numbers)) ? $numbers['stability'] : null;

        if (null === $stability || 0 === mb_strlen($stability)) {
            $stability = 'stable';
        }

        $stability = mb_strtolower($stability);
        switch ($stability) {
            case 'rc':
                $stability = 'RC';

                break;
            case 'patch':
            case 'pl':
            case 'p':
                $stability = 'patch';

                break;
            case 'beta':
            case 'b':
                $stability = 'beta';

                break;
            case 'alpha':
            case 'a':
                $stability = 'alpha';

                break;
            case 'dev':
            case 'd':
                $stability = 'dev';

                break;
        }

        $build = (array_key_exists('build', $numbers)) ? $numbers['build'] : null;

        return new Version($major, $minor, $micro, $patch, $micropatch, $stability, $build);
    }
643259
public function setVersion($version)
    {
        if ($version != '1.1' && $version != '1.0') {
            throw new InvalidArgumentException('Not valid or not supported HTTP version: ' . $version);
        }

        $this->_version = $version;
        return $this;
    }
1103502
public function withVersion(int $version): self
    {
        $obj = clone $this;
        $obj->_version = $version;
        return $obj;
    }
341543
public function selectVersion($version)
	{
		if ( ! in_array($version, $this->versions))
		{
			// not a value version
			return false;
		}

		$this->version = $version;

		return $this;
	}
637039
public function put_version($collection, $version)
    {
        if ($version) {
            $this->get_versions();
            $this->versions[$collection] = $version;
            $version_path = $this->get_path('versions');
            return $this->write_cache($version_path, $this->versions);
        }
    }
346535
public function setVersionMapping(array &$mapping)
    {
        if ($mapping['type'] !== 'int' && $mapping['type'] !== 'date') {
            throw LockException::invalidVersionFieldType($mapping['type']);
        }

        $this->isVersioned  = true;
        $this->versionField = $mapping['fieldName'];
    }
1366328
protected function setReleaseVersion()
    {
        try {
            $currentVersion = Context::get('version-persister')->getCurrentVersion();
        } catch (\Exception $e) {
            $currentVersion = Context::get('version-generator')->getInitialVersion();
        }

        $this->releaseVersion = Context::get('version-generator')->generateNextVersion($currentVersion);
    }
1102762
public function setVersion($version)
    {

        if (!is_null($version) && (!preg_match("/^(([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?)?$/", $version))) {
            throw new \InvalidArgumentException("invalid value for $version when calling Stack., must conform to the pattern /^(([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)\\.([0-9]|[1-9][0-9]*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?)?$/.");
        }

        $this->container['version'] = $version;

        return $this;
    }
293044
public function setVersion($version)
    {
        if(!is_float($version)){
            $version = (float) 1.1;
        }

        $this->options['version']=$version;
        return $this;
    }
1166027
private function validateProtocolVersion($version): void
    {
        if (empty($version)) {
            throw new \InvalidArgumentException(
                'HTTP protocol version can not be empty'
            );
        }
        if (!\is_string($version)) {
            throw new \InvalidArgumentException(sprintf(
                'Unsupported HTTP protocol version; must be a string, received %s',
                (\is_object($version) ? \get_class($version) : \gettype($version))
            ));
        }

        // HTTP/1 uses a "<major>.<minor>" numbering scheme to indicate
        // versions of the protocol, while HTTP/2 does not.
        if (!\preg_match('#^(1\.[01]|2)$#', $version)) {
            throw new \InvalidArgumentException(\sprintf(
                'Unsupported HTTP protocol version "%s" provided',
                $version
            ));
        }
    }
299200
public static void setVersion(Object object, int version) {
		try {
			Field versionField = object.getClass().getField("version");
			versionField.set(object, version);
		} catch (NoSuchFieldException | SecurityException | IllegalAccessException e) {
			throw new RuntimeException(e);
		}
	}
940741
public function setHTTPVersion(int $version)
    {
        $this->http_version = ($version === 1 ? '1.0' : '' . $version);

        if ($this->http_version !== '1.0' && $this->http_version !== '1.1') {
            throw new RuntimeException('HTTP version  must be 1.0 or 1.1');
        }
    }
1082190
public function version($version = null)
    {
        if (func_num_args() === 0) {
            return $this->_version;
        }
        $headers = $this->headers();
        $headers->prepend('MIME-Version', $version);
        $this->_version = $version;
        return $this;
    }
300150
private function setResourceVersion($value)
    {
        if ($value > $this->resourceVersion || $value === null) {
            $this->resourceVersion = $value;
        }
    }