public function setVersion(string $version)
    {
        if (Validation::isValidVersionRegex($version)) {
            $this->version = $version;
        } else {
            throw new CustomException('Malformed version');
        }
    }
public function setVersion(string $version)
    {
        if (Validation::isValidVersionRegex($version)) {
            $this->version = $version;
        } else {
            throw new CustomException('Malformed version');
        }
    }
public function setVersion ( string $ version ) { if ( Validation :: isValidVersionRegex ( $ version ) ) { $ this -> version = $ version ; } else { throw new CustomException ( 'Malformed version' ) ; } }
Set the version if it is valid

@var string $version
Set the version if it is valid