Sets the version number for this template.

@param string $version Semantic version number in this format: 1.0.0

@throws \InvalidArgumentException if the version number is invalid
551048
public function setVersion(string $version)
    {
        if (!preg_match('/^\d+\.\d+\.\d+$/', $version)) {
            throw new \InvalidArgumentException(
                'Version number is invalid; ' . $version . ' does not match '
                . 'x.x.x (where x is a number)'
            );
        }

        $this->version = $version;
    }
1218397
protected function setVersion($version) {
    if ($version == self::V3 || $version == self::V4 || $version == self::V5) {
      $this->version = $version;
    }
    else {
      throw new Exception('An invalid UUID version was specified.');
    }
  }
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;
    }
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;
    }
92060
private function setVersionFromRequest(array $versions)
    {
        $this->setDefaultVersion($versions);

        foreach ($versions as $v) {
            if ($v->canParseRequest()) {
                $this->version = $v;
                break;
            }
        }
    }
814130
public function setProtocolVersion($version)
	{
		if (!array_key_exists($version, self::$protocolVersionMap)) {
			throw new InvalidArgumentException(sprintf('The HTTP protkoll version %s is unknown', $version));			
		}

		$this->protocolVersion = $version;

		return $this;
	}
479
public function savePreviousVersion($version)
    {
        if (!is_numeric($version)) {
            return;
        }

        try {
            $this->setVersionNumber($version);
            $this->owner->write();
        } catch (Exception $e) {
            throw new ValidationException(new ValidationResult(
                false,
                "Could not replace file #{$this->owner->ID} with version #$version."
            ));
        }
    }
1092886
protected static function standardizeVersion($version)
    {
        if (\is_string($version)) {
            $version = explode('.', $version);
        }

        while (\count($version) < 3) {
            $version[] = '0';
        }

        return implode('.', $version);
    }
1046181
private function runParentClass($version)
    {
        $this->setAutoExit(false);
        $this->setCatchExceptions(true);

        // now we will register applicatio name and version,
        // application name by default is Anonym.
        parent::__construct('Anonym', $version);
    }
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;
    }
597028
public function setNewVersion($new_version)
    {

        if (!is_null($new_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-]+)?)?$/", $new_version))) {
            throw new \InvalidArgumentException("invalid value for $new_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['new_version'] = $new_version;

        return $this;
    }
123316
public function imageVersion($version, $options = []) {
		$options['version'] = $version;
		$options['image'] = $this;
		$options['hash'] = Configure::read('FileStorage.imageHashes.' . $this->_properties['model'] . '.' . $version);

		if (empty($options['hash'])) {
			throw new InvalidArgumentException(sprintf('No valid version key (Identifier: `%s` Key: `%s`) passed!', $this->get('model'), $version));
		}

		$event = $this->dispatchEvent('ImageVersion.getVersions', $options);

		return $event->getResult();
	}
293044
public function setVersion($version)
    {
        if(!is_float($version)){
            $version = (float) 1.1;
        }

        $this->options['version']=$version;
        return $this;
    }
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;
    }
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);
        }
    }
480219
protected function assertProtocolVersion($version)
    {
        if (!is_string($version) && !is_numeric($version)) {
            throw new \InvalidArgumentException("HTTP version must be a string or float");
        }
        
        if ($version != '' && $version !== "1.0" && $version !== "1.1" && $version !== "2") {
            throw new \InvalidArgumentException("Invalid HTTP protocol version '$version'");
        }
    }
1215442
public function setVersion(\AgentSIB\Diadoc\Api\Proto\Invoicing\InvoiceFormatVersion $value = null)
    {
        $this->Version = $value;
    }