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;
    }
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;
    }
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 ; }
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
Sets the version number for this template .